From 6c7f009c0d4c250cb5c52b8a28c68d4ec60c4399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Thu, 30 Jan 2025 19:51:17 +0100 Subject: [PATCH 1/7] [NAE-2038] - Public View - add all nessesery public view components into engine default components --- .../src/app/nae-example-app-view.service.ts | 14 ++- .../abstract-task-panel.component.ts | 2 +- .../lib/view/abstract/view-with-headers.ts | 2 +- .../abstract-single-task-view.component.ts | 4 - .../default-public-resolver.component.html | 4 + .../default-public-resolver.component.scss | 0 .../default-public-resolver.component.spec.ts | 43 ++++++++ .../default-public-resolver.component.ts | 46 ++++++++ ...ult-public-single-task-view.component.html | 7 ++ ...ult-public-single-task-view.component.scss | 19 ++++ ...-public-single-task-view.component.spec.ts | 47 ++++++++ ...fault-public-single-task-view.component.ts | 101 ++++++++++++++++++ .../default-public-task-view.component.html | 7 ++ .../default-public-task-view.component.scss | 27 +++++ ...default-public-task-view.component.spec.ts | 46 ++++++++ .../default-public-task-view.component.ts | 60 +++++++++++ ...efault-public-workflow-view.component.html | 37 +++++++ ...efault-public-workflow-view.component.scss | 32 ++++++ ...ult-public-workflow-view.component.spec.ts | 61 +++++++++++ .../default-public-workflow-view.component.ts | 31 ++++++ .../src/lib/navigation/navigation.module.ts | 60 +++++++---- .../src/lib/navigation/public-api.ts | 4 + .../task-panel/task-panel.component.html | 2 +- 23 files changed, 624 insertions(+), 32 deletions(-) create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.html create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.scss create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.spec.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.html create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.scss create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.spec.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.html create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.scss create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.spec.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.html create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.scss create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.spec.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.ts diff --git a/projects/nae-example-app/src/app/nae-example-app-view.service.ts b/projects/nae-example-app/src/app/nae-example-app-view.service.ts index cf6c809b1b..b064714fe0 100644 --- a/projects/nae-example-app/src/app/nae-example-app-view.service.ts +++ b/projects/nae-example-app/src/app/nae-example-app-view.service.ts @@ -37,11 +37,15 @@ import {ExampleRedirectComponent} from './doc/redirect/example-redirect.componen import {ActiveGroupComponent} from './doc/active-group/active-group.component'; import {WrapperEmptyViewComponent} from './views/wrapper/wrapper-empty-view.component'; import {DoubleDrawerExampleComponent} from './doc/double-drawer-example/double-drawer-example.component'; -import {PublicSingleTaskViewComponent} from './doc/public-single-task-view/public-single-task-view.component'; import {BreadcrumbsExampleComponent} from './doc/breadcrumbs-example/breadcrumbs-example.component'; import {DashboardCaseExampleComponent} from './doc/dashboard-case-example/dashboard-case-example.component'; import {ImpersonationDemoComponent} from './doc/impersonation-demo/impersonation-demo.component'; import {ChangePasswordComponent} from "./doc/forms/change-password/change-password.component"; +import { + DefaultPublicResolverComponent, DefaultPublicSingleTaskViewComponent, + DefaultPublicTaskViewComponent, + DefaultPublicWorkflowViewComponent +} from "@netgrif/components"; @Injectable({ providedIn: 'root' @@ -54,7 +58,7 @@ export class NaeExampleAppViewService extends ViewService { {id: 'ImpersonationDemoComponent', class: ImpersonationDemoComponent}, {id: 'BreadcrumbsExampleComponent', class: BreadcrumbsExampleComponent}, {id: 'TitleConfigComponent', class: TitleConfigComponent}, - {id: 'PublicSingleTaskViewComponent', class: PublicSingleTaskViewComponent}, + {id: 'PublicSingleTaskViewComponent', class: DefaultPublicSingleTaskViewComponent}, {id: 'WrapperEmptyViewComponent', class: WrapperEmptyViewComponent}, {id: 'ActiveGroupComponent', class: ActiveGroupComponent}, {id: 'ExampleRedirectComponent', class: ExampleRedirectComponent}, @@ -88,9 +92,9 @@ export class NaeExampleAppViewService extends ViewService { {id: 'AuthenticationComponent', class: AuthenticationComponent}, {id: 'RolesAssignComponent', class: RolesAssignComponent}, {id: 'LdapGroupRolesAssignComponent', class: LdapGroupRolesAssignComponent}, - {id: 'PublicTaskViewComponent', class: PublicTaskViewComponent}, - {id: 'PublicWorkflowViewComponent', class: PublicWorkflowViewComponent}, - {id: 'PublicResolverComponent', class: PublicResolverComponent}, + {id: 'PublicTaskViewComponent', class: DefaultPublicTaskViewComponent}, + {id: 'PublicWorkflowViewComponent', class: DefaultPublicWorkflowViewComponent}, + {id: 'PublicResolverComponent', class: DefaultPublicResolverComponent}, { id: 'ResetPasswordFormComponent', class: ResetPasswordFormComponent 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 fbbc2aa4d1..eedeff76f9 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 @@ -170,7 +170,7 @@ export abstract class AbstractTaskPanelComponent extends AbstractPanelWithImmedi this.expand(); }); _taskOperations.close$.subscribe(() => { - if (!this._taskForceOpen) { + if (!(this._taskForceOpen || this.preventCollapse)) { this.collapse(); } }); diff --git a/projects/netgrif-components-core/src/lib/view/abstract/view-with-headers.ts b/projects/netgrif-components-core/src/lib/view/abstract/view-with-headers.ts index ec017d7896..907b903e7c 100644 --- a/projects/netgrif-components-core/src/lib/view/abstract/view-with-headers.ts +++ b/projects/netgrif-components-core/src/lib/view/abstract/view-with-headers.ts @@ -15,7 +15,7 @@ export abstract class AbstractViewWithHeadersComponent implements OnDestroy { public config: Params; protected _selectedHeaders$: ReplaySubject>; - protected constructor(private _sortableView?: AbstractSortableViewComponent, protected _activatedRoute?: ActivatedRoute) { + protected constructor(protected _sortableView?: AbstractSortableViewComponent, protected _activatedRoute?: ActivatedRoute) { this._selectedHeaders$ = new ReplaySubject>(1); if (!!_activatedRoute) { this._activatedRoute.queryParams.subscribe(paramMap => this.config = paramMap); 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 930ea00621..4486f727ff 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 @@ -10,10 +10,6 @@ import {TaskSearchRequestBody} from "../../filter/models/task-search-request-bod import {NAE_BASE_FILTER} from "../../search/models/base-filter-injection-token"; import {map, tap} from "rxjs/operators"; -export class TaskConst { - public static readonly TRANSITION_ID = 'transitionId'; -} - @Component({ selector: 'ncc-abstract-single-task-view', template: '' diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.html new file mode 100644 index 0000000000..af07136618 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.html @@ -0,0 +1,4 @@ +
+ + {{ 'publicView.resolving' | translate }} +
diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.spec.ts new file mode 100644 index 0000000000..16fd09272c --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.spec.ts @@ -0,0 +1,43 @@ +import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; + +import { DefaultPublicResolverComponent } from './default-public-resolver.component'; +import {HttpClientTestingModule} from "@angular/common/http/testing"; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {RouterTestingModule} from "@angular/router/testing"; +import {AuthenticationMethodService, + ConfigurationService, MaterialModule, MockAuthenticationMethodService, + TestConfigurationService, TranslateLibModule, UserService } from '@netgrif/components-core'; + +describe('DefaultPublicResolverComponent', () => { + let component: DefaultPublicResolverComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DefaultPublicResolverComponent], + imports: [ + HttpClientTestingModule, + MaterialModule, + BrowserAnimationsModule, + RouterTestingModule.withRoutes([]), + TranslateLibModule + ], + providers: [ + {provide: AuthenticationMethodService, useClass: MockAuthenticationMethodService}, + {provide: ConfigurationService, useClass: TestConfigurationService}, + UserService + ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultPublicResolverComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.ts new file mode 100644 index 0000000000..e3005b2302 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component.ts @@ -0,0 +1,46 @@ +import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Subscription} from "rxjs"; +import {Router} from "@angular/router"; +import { + AuthenticationService, + PublicUrlResolverService, + RedirectService, + SessionService, + UserService +} from '@netgrif/components-core'; + +@Component({ + selector: 'nc-default-public-resolver', + templateUrl: './default-public-resolver.component.html', + styleUrls: ['./default-public-resolver.component.scss'] +}) +export class DefaultPublicResolverComponent implements OnInit, OnDestroy { + + protected _userSub: Subscription; + + constructor(protected _userService: UserService, protected _sessionService: SessionService, protected _router: Router, + protected _auth: AuthenticationService, protected _publicResolver: PublicUrlResolverService, + protected redirectService: RedirectService) { + } + + ngOnInit(): void { + this._userSub = this._userService.user$.subscribe(user => { + if (!!user && user.id !== '') { + this._router.navigate([this.redirectService.parseRedirectPath(this._publicResolver.url)], + {queryParams: this.redirectService.queryParams}); + this._publicResolver.url = undefined; + } else { + if (!this._sessionService.verified && !this._sessionService.isVerifying && + this._sessionService.isInitialized && !this._auth.isAuthenticated) { + this._router.navigate([this.redirectService.parseRedirectPath(this._publicResolver.url)], + {queryParams: this.redirectService.queryParams}); + this._publicResolver.url = undefined; + } + } + }); + } + + ngOnDestroy(): void { + this._userSub.unsubscribe(); + } +} diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.html new file mode 100644 index 0000000000..b584d8a8a0 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.html @@ -0,0 +1,7 @@ +
+
+ +
+
+ diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.scss new file mode 100644 index 0000000000..d83b2ed3d6 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.scss @@ -0,0 +1,19 @@ +.task-tab-background{ + height: 100%; + width: 100%; + overflow: auto; + background-color: transparent; +} + +.content-margin{ + margin: 0 8px; +} +.task-panel-padding-mini{ + padding-bottom: 8px; + padding-top: 8px; +} + +.full-height { + height: 100%; +} + diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.spec.ts new file mode 100644 index 0000000000..7d9902296e --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.spec.ts @@ -0,0 +1,47 @@ +import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; + +import {DefaultPublicSingleTaskViewComponent} from './default-public-single-task-view.component'; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {RouterTestingModule} from "@angular/router/testing"; +import {Observable} from "rxjs"; +import {AuthenticationMethodService, + ConfigurationService, FilterType, MaterialModule, NAE_TAB_DATA, SimpleFilter, TestConfigurationService } from '@netgrif/components-core'; +import {HeaderComponentModule} from "../../../../../header/header.module"; +import {PanelComponentModule} from "../../../../../panel/panel.module"; + +describe('DefaultPublicSingleTaskViewComponent', () => { + let component: DefaultPublicSingleTaskViewComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + MaterialModule, + HeaderComponentModule, + PanelComponentModule, + BrowserAnimationsModule, + RouterTestingModule.withRoutes([]) + ], + providers: [ + { + provide: NAE_TAB_DATA, + useValue: {baseFilter: new SimpleFilter('id', FilterType.TASK, {}), tabSelected$: new Observable()} + }, + AuthenticationMethodService, + {provide: ConfigurationService, useClass: TestConfigurationService} + ], + declarations: [DefaultPublicSingleTaskViewComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultPublicSingleTaskViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts new file mode 100644 index 0000000000..9eb86c067f --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts @@ -0,0 +1,101 @@ +import {AfterViewInit, Component, Inject, OnInit, ViewChild} from '@angular/core'; +import {ActivatedRoute, Router} from "@angular/router"; +import {AsyncPipe} from "@angular/common"; +import {combineLatest} from "rxjs"; +import {map} from "rxjs/operators"; +import { + TaskViewService, + PublicTaskLoadingService, + SearchService, + RedirectService, + ChangedFieldsService, + ProcessServiceProvider, + TaskResourceServiceProvider, + CaseResourceServiceProvider, + BaseFilterFactoryProvider, + AllowedNetsService, + AllowedNetsServiceFactory, + NAE_VIEW_ID_SEGMENT, + ViewIdService, + TaskContentService, + SingleTaskContentService, + TaskDataService, + FinishTaskService, + TaskRequestStateService, + TaskEventService, + NAE_TASK_OPERATIONS, + SubjectTaskOperations, + AbstractSingleTaskViewComponent, + NAE_BASE_FILTER, + BaseFilter, +} from '@netgrif/components-core'; +import {HeaderComponent} from "../../../../../header/header.component"; + +const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, route: ActivatedRoute) => { + const array = []; + if (route.snapshot.paramMap.get('petriNetId') !== null) { + array.push(route.snapshot.paramMap.get('petriNetId')); + } + return factory.createFromArray(array); +}; + +@Component({ + selector: 'nc-default-public-single-task-view', + templateUrl: './default-public-single-task-view.component.html', + styleUrls: ['./default-public-single-task-view.component.scss'], + providers: [ + TaskViewService, + PublicTaskLoadingService, + SearchService, + RedirectService, + ChangedFieldsService, + ProcessServiceProvider, + TaskResourceServiceProvider, + CaseResourceServiceProvider, + BaseFilterFactoryProvider, + { + provide: AllowedNetsService, + useFactory: localAllowedNetsServiceFactory, + deps: [AllowedNetsServiceFactory, ActivatedRoute] + }, + {provide: NAE_VIEW_ID_SEGMENT, useValue: 'publicTaskView'}, + {provide: AllowedNetsServiceFactory, useClass: AllowedNetsServiceFactory}, + ViewIdService, + {provide: TaskContentService, useClass: SingleTaskContentService}, + TaskDataService, + FinishTaskService, + TaskRequestStateService, + TaskEventService, + {provide: NAE_TASK_OPERATIONS, useClass: SubjectTaskOperations}, + {provide: AllowedNetsServiceFactory, useClass: AllowedNetsServiceFactory}, + AsyncPipe + ] +}) +export class DefaultPublicSingleTaskViewComponent extends AbstractSingleTaskViewComponent implements OnInit, AfterViewInit { + + @ViewChild('header') public taskHeaderComponent: HeaderComponent; + + hidden: boolean; + + constructor(taskViewService: TaskViewService, + publicTaskLoadingService: PublicTaskLoadingService, + activatedRoute: ActivatedRoute, + protected _router: Router, + @Inject(NAE_BASE_FILTER) baseFilter: BaseFilter) { + super(taskViewService, activatedRoute, baseFilter); + this.hidden = false; + this.loading$ = combineLatest(taskViewService.loading$, publicTaskLoadingService.loading$).pipe( + map(sources => { + return sources[0] || sources[1]; + }) + ); + } + + ngOnInit(): void { + this._router.routeReuseStrategy.shouldReuseRoute = () => false + } + + ngAfterViewInit(): void { + this.initializeHeader(this.taskHeaderComponent); + } +} diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.html new file mode 100644 index 0000000000..5fc86e7961 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.html @@ -0,0 +1,7 @@ +
+
+ + +
+
+ diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.scss new file mode 100644 index 0000000000..8cc27613b9 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.scss @@ -0,0 +1,27 @@ +.task-tab-background { + height: 100%; + width: 100%; + overflow: auto; + background-color: transparent; +} + +.content-margin { + margin: 8px 24px 0; +} + +@media screen and (max-width: 599.99px) { + .content-margin { + margin: 8px 12px 0; + } +} + +.task-panel-padding-mini { + padding-top: 16px; + padding-left: 1px; + padding-right: 1px; +} + +.full-height { + height: calc(100% - 8px); +} + diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.spec.ts new file mode 100644 index 0000000000..ee587b0b79 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.spec.ts @@ -0,0 +1,46 @@ +import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; + +import {DefaultPublicTaskViewComponent} from './default-public-task-view.component'; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {RouterTestingModule} from "@angular/router/testing"; +import {Observable} from "rxjs"; +import {AuthenticationMethodService, ConfigurationService, FilterType, MaterialModule, NAE_TAB_DATA, SimpleFilter, TestConfigurationService } from '@netgrif/components-core'; +import {PanelComponentModule} from "../../../../../panel/panel.module"; +import {HeaderComponentModule} from "../../../../../header/header.module"; + +describe('DefaultPublicTaskViewComponent', () => { + let component: DefaultPublicTaskViewComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + MaterialModule, + HeaderComponentModule, + PanelComponentModule, + BrowserAnimationsModule, + RouterTestingModule.withRoutes([]) + ], + providers: [ + { + provide: NAE_TAB_DATA, + useValue: {baseFilter: new SimpleFilter('id', FilterType.TASK, {}), tabSelected$: new Observable()} + }, + AuthenticationMethodService, + {provide: ConfigurationService, useClass: TestConfigurationService} + ], + declarations: [DefaultPublicTaskViewComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultPublicTaskViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.ts new file mode 100644 index 0000000000..58f7146494 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component.ts @@ -0,0 +1,60 @@ +import {AfterViewInit, Component, ViewChild} from '@angular/core'; +import {ActivatedRoute} from "@angular/router"; +import {AbstractTaskViewComponent, + AllowedNetsService, + AllowedNetsServiceFactory, BaseFilterFactoryProvider, CaseResourceServiceProvider, ChangedFieldsService, + NAE_VIEW_ID_SEGMENT, + ProcessServiceProvider, PublicTaskLoadingService, SearchService, TaskResourceServiceProvider, TaskViewService, ViewIdService} from '@netgrif/components-core'; +import {combineLatest} from "rxjs"; +import {map} from "rxjs/operators"; +import {HeaderComponent} from "../../../../../header/header.component"; + +const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, route: ActivatedRoute) => { + const array = []; + if (route.snapshot.paramMap.get('petriNetId') !== null) { + array.push(route.snapshot.paramMap.get('petriNetId')); + } + return factory.createFromArray(array); +}; + +@Component({ + selector: 'nc-default-public-task-view', + templateUrl: './default-public-task-view.component.html', + styleUrls: ['./default-public-task-view.component.scss'], + providers: [ + TaskViewService, + PublicTaskLoadingService, + SearchService, + ChangedFieldsService, + ProcessServiceProvider, + TaskResourceServiceProvider, + CaseResourceServiceProvider, + BaseFilterFactoryProvider, + { + provide: AllowedNetsService, + useFactory: localAllowedNetsServiceFactory, + deps: [AllowedNetsServiceFactory, ActivatedRoute] + }, + {provide: NAE_VIEW_ID_SEGMENT, useValue: 'publicView'}, + {provide: AllowedNetsServiceFactory, useClass: AllowedNetsServiceFactory}, + ViewIdService, + ] +}) +export class DefaultPublicTaskViewComponent extends AbstractTaskViewComponent implements AfterViewInit { + + @ViewChild('header') public taskHeaderComponent: HeaderComponent; + + constructor(taskViewService: TaskViewService, publicTaskLoadingService: PublicTaskLoadingService, + activatedRoute: ActivatedRoute) { + super(taskViewService, activatedRoute); + this.loading$ = combineLatest(taskViewService.loading$, publicTaskLoadingService.loading$).pipe( + map(sources => { + return sources[0] || sources[1]; + }) + ); + } + + ngAfterViewInit(): void { + this.initializeHeader(this.taskHeaderComponent); + } +} diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.html new file mode 100644 index 0000000000..ecd0aa48a6 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.html @@ -0,0 +1,37 @@ +
+
+ +
+
+ + +
+ linear_scale + + {{ 'view-list.noProcessesSatisfyingThisFilter' | translate}} +
+ + + + + + + + +
+ +
+ +
+ +
+
+
+
+ diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.scss new file mode 100644 index 0000000000..01a9488b0d --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.scss @@ -0,0 +1,32 @@ +.workflow-container { + padding: 8px; +} + +.workflow-header { + margin-top: 8px; +} + +.workflow-panels-container { + margin-top: 8px; +} + +.full-width { + width: 100%; +} + +.full-height { + height: 100%; +} + +.font-size-20 { + font-size: 20px; +} + +.font-size-40 { + font-size: 40px; +} + +.block-size-40 { + width: 40px; + height: 40px; +} diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.spec.ts new file mode 100644 index 0000000000..0ce2104cc3 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.spec.ts @@ -0,0 +1,61 @@ +import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; + +import {DefaultPublicWorkflowViewComponent} from './default-public-workflow-view.component'; +import {NoopAnimationsModule} from "@angular/platform-browser/animations"; +import {HttpClientTestingModule} from "@angular/common/http/testing"; +import {RouterModule} from "@angular/router"; +import {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from "@angular/core"; +import {AuthenticationMethodService, + AuthenticationService, ConfigurationService, MaterialModule, MockAuthenticationMethodService, + MockAuthenticationService, MockUserResourceService, + OverflowService, + TestConfigurationService, TestViewService, TranslateLibModule, UserResourceService, ViewService, WorkflowHeaderService } from '@netgrif/components-core'; +import {PanelComponentModule} from "../../../../../panel/panel.module"; +import {HeaderComponentModule} from "../../../../../header/header.module"; +import { + SideMenuContentComponentModule +} from "../../../../../side-menu/content-components/side-menu-content-component.module"; + +describe('DefaultPublicWorkflowViewComponent', () => { + let component: DefaultPublicWorkflowViewComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ + DefaultPublicWorkflowViewComponent + ], + imports: [ + MaterialModule, + NoopAnimationsModule, + PanelComponentModule, + HeaderComponentModule, + HttpClientTestingModule, + SideMenuContentComponentModule, + TranslateLibModule, + RouterModule.forRoot([], {relativeLinkResolution: 'legacy'}) + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], + providers: [ + {provide: AuthenticationMethodService, useClass: MockAuthenticationMethodService}, + {provide: AuthenticationService, useClass: MockAuthenticationService}, + {provide: UserResourceService, useClass: MockUserResourceService}, + {provide: ConfigurationService, useClass: TestConfigurationService}, + {provide: ViewService, useClass: TestViewService}, + WorkflowHeaderService, + OverflowService + ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultPublicWorkflowViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.ts new file mode 100644 index 0000000000..25e7c0f60b --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component.ts @@ -0,0 +1,31 @@ +import {Component} from '@angular/core'; +import {MatDialog} from "@angular/material/dialog"; +import {ActivatedRoute, Router} from "@angular/router"; +import {AbstractWorkflowViewComponent, + LoggerService, Net, PetriNetResourceServiceProvider, ProcessService, ProcessServiceProvider, WorkflowViewService } from '@netgrif/components-core'; + +@Component({ + selector: 'nc-default-public-workflow-view', + templateUrl: './default-public-workflow-view.component.html', + styleUrls: ['./default-public-workflow-view.component.scss'], + providers: [ + WorkflowViewService, + ProcessServiceProvider, + PetriNetResourceServiceProvider, + ] +}) +export class DefaultPublicWorkflowViewComponent extends AbstractWorkflowViewComponent { + constructor(protected _dialog: MatDialog, + protected _workflowViewService: WorkflowViewService, + protected _log: LoggerService, + protected _processService: ProcessService, + protected _router: Router, + protected _route: ActivatedRoute) { + super(_dialog, _workflowViewService, _log, _processService); + } + + handleClick(workflow: Net) { + this._router.navigate([this._route.snapshot.url.join('/') + '/' + btoa(workflow.identifier)]); + } + +} diff --git a/projects/netgrif-components/src/lib/navigation/navigation.module.ts b/projects/netgrif-components/src/lib/navigation/navigation.module.ts index 9648ab9dc4..aa2fd62d49 100644 --- a/projects/netgrif-components/src/lib/navigation/navigation.module.ts +++ b/projects/netgrif-components/src/lib/navigation/navigation.module.ts @@ -46,6 +46,14 @@ import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component'; import { DefaultTaskViewComponent } from './group-navigation-component-resolver/default-components/default-task-view/default-task-view.component'; import { DefaultCaseRefListViewComponent } from './group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component'; import { DefaultNoFilterProvidedComponent } from './group-navigation-component-resolver/default-components/default-no-filter-provided/default-no-filter-provided.component'; +import { DefaultPublicResolverComponent } from './group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component'; +import {TranslateModule} from "@ngx-translate/core"; +import { DefaultPublicSingleTaskViewComponent } from './group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component'; +import {MatButtonModule} from "@angular/material/button"; +import {MatCardModule} from "@angular/material/card"; +import {MatIconModule} from "@angular/material/icon"; +import { DefaultPublicTaskViewComponent } from './group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component'; +import { DefaultPublicWorkflowViewComponent } from './group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component'; @NgModule({ @@ -63,27 +71,35 @@ import { DefaultNoFilterProvidedComponent } from './group-navigation-component-r DefaultTaskViewComponent, DefaultCaseRefListViewComponent, BreadcrumbsComponent, - DefaultNoFilterProvidedComponent + DefaultNoFilterProvidedComponent, + DefaultPublicResolverComponent, + DefaultPublicSingleTaskViewComponent, + DefaultPublicTaskViewComponent, + DefaultPublicWorkflowViewComponent ], - imports: [ - CommonModule, - RouterModule, - MaterialModule, - FlexModule, - FlexLayoutModule, - QuickPanelComponentModule, - TranslateLibModule, - UserComponentModule, - ResizableModule, - MatProgressSpinnerModule, - SearchComponentModule, - HeaderComponentModule, - PanelComponentModule, - TabsComponentModule, - CaseViewComponentModule, - MatDividerModule, + imports: [ + CommonModule, + RouterModule, + MaterialModule, + FlexModule, + FlexLayoutModule, + QuickPanelComponentModule, + TranslateLibModule, + UserComponentModule, + ResizableModule, + MatProgressSpinnerModule, + SearchComponentModule, + HeaderComponentModule, + PanelComponentModule, + TabsComponentModule, + CaseViewComponentModule, + MatDividerModule, UtilityModule, - ], + TranslateModule, + MatButtonModule, + MatCardModule, + MatIconModule, + ], exports: [ NavigationDrawerComponent, NavigationDoubleDrawerComponent, @@ -94,7 +110,11 @@ import { DefaultNoFilterProvidedComponent } from './group-navigation-component-r DefaultTabbedTaskViewComponent, DefaultTabbedCaseViewComponent, DefaultTabViewComponent, - BreadcrumbsComponent + BreadcrumbsComponent, + DefaultPublicResolverComponent, + DefaultPublicSingleTaskViewComponent, + DefaultPublicTaskViewComponent, + DefaultPublicWorkflowViewComponent ], providers: [ { provide: NAE_GROUP_NAVIGATION_COMPONENT_RESOLVER_COMPONENT, useValue: GroupNavigationComponentResolverComponent }, diff --git a/projects/netgrif-components/src/lib/navigation/public-api.ts b/projects/netgrif-components/src/lib/navigation/public-api.ts index 29cf398723..cb253f90e5 100644 --- a/projects/netgrif-components/src/lib/navigation/public-api.ts +++ b/projects/netgrif-components/src/lib/navigation/public-api.ts @@ -16,6 +16,10 @@ export * from './group-navigation-component-resolver/default-components/default- export * from './group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component'; export * from './breadcrumbs/breadcrumbs.component'; export * from './group-navigation-component-resolver/default-components/default-task-view/default-task-view.component'; +export * from './group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component'; +export * from './group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component'; +export * from './group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component'; +export * from './group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component'; /* FUNCTIONS */ export * from './group-navigation-component-resolver/default-components/model/factory-methods'; diff --git a/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.html b/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.html index ddbd3358ae..0d0fa8fe4b 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.html +++ b/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.html @@ -95,6 +95,6 @@ - From 431c3a86b3ec5579efbcbac4e7cc666d941ad120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Fri, 31 Jan 2025 11:33:15 +0100 Subject: [PATCH 2/7] [NAE-2038] - Public View - fix tests --- .../changed-fields/services/changed-fields.service.ts | 2 +- .../src/lib/configuration/configuration.service.ts | 2 +- .../src/lib/event/services/event.service.ts | 6 +++--- .../src/lib/header/services/overflow.service.ts | 2 +- .../src/lib/logger/services/log-publisher.service.ts | 2 +- .../abstract-navigation-double-drawer.ts | 2 +- .../panel/task-panel/abstract-task-panel.component.ts | 2 +- .../src/lib/resources/resource-provider.service.ts | 6 +++--- .../lib/routing/redirect-service/redirect.service.ts | 2 +- .../lib/search/models/category/case/case-dataset.ts | 2 +- .../src/lib/search/models/operator/operator.ts | 2 +- .../abstract-multi-user-assign-list.component.spec.ts | 2 +- .../src/lib/task-content/model/subgrid.spec.ts | 6 +++--- .../task-content/services/field-converter.service.ts | 2 +- .../lib/task-content/services/task-content.service.ts | 6 +++--- .../src/lib/task/services/task-data.service.ts | 6 +++--- .../src/lib/user/services/user-comparator.service.ts | 2 +- .../src/lib/utility/contains.pipe.ts | 2 +- .../default-public-single-task-view.component.ts | 11 ++--------- .../src/lib/panel/case-panel/case-panel.component.ts | 4 ++-- 20 files changed, 32 insertions(+), 39 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/changed-fields/services/changed-fields.service.ts b/projects/netgrif-components-core/src/lib/changed-fields/services/changed-fields.service.ts index b0f26cea58..e3d3e2460f 100644 --- a/projects/netgrif-components-core/src/lib/changed-fields/services/changed-fields.service.ts +++ b/projects/netgrif-components-core/src/lib/changed-fields/services/changed-fields.service.ts @@ -30,7 +30,7 @@ export class ChangedFieldsService implements OnDestroy { public parseChangedFieldsByCaseAndTaskIds(caseId: string, taskIds: Array, changedFieldsMap: ChangedFieldsMap): Array { const changedFields: Array = []; - const filteredTaskIds: Array = Object.keys(changedFieldsMap[caseId]).filter(taskId => taskIds.includes(taskId)); + const filteredTaskIds: Array = Object.keys(changedFieldsMap[caseId]).filter(taskId => taskIds?.includes(taskId)); filteredTaskIds.forEach(taskId => { changedFields.push(changedFieldsMap[caseId][taskId]); }); diff --git a/projects/netgrif-components-core/src/lib/configuration/configuration.service.ts b/projects/netgrif-components-core/src/lib/configuration/configuration.service.ts index 1786ace665..dab430254f 100644 --- a/projects/netgrif-components-core/src/lib/configuration/configuration.service.ts +++ b/projects/netgrif-components-core/src/lib/configuration/configuration.service.ts @@ -54,7 +54,7 @@ export abstract class ConfigurationService { map = this.getChildren(views, map, ''); if (map.get(url) === undefined) { for (const [key, value] of map) { - if (key.includes('/**') && url.includes(key.split('/**')[0])) + if (key?.includes('/**') && url?.includes(key.split('/**')[0])) return value; } } diff --git a/projects/netgrif-components-core/src/lib/event/services/event.service.ts b/projects/netgrif-components-core/src/lib/event/services/event.service.ts index 1b29f1a6f9..b8805bbfdc 100644 --- a/projects/netgrif-components-core/src/lib/event/services/event.service.ts +++ b/projects/netgrif-components-core/src/lib/event/services/event.service.ts @@ -29,17 +29,17 @@ export class EventService { const setDataOutcome: SetDataEventOutcome = childOutcome as SetDataEventOutcome; const outcomeChangedFields: ChangedFields = (childOutcome as SetDataEventOutcome).changedFields.changedFields; const caseId = setDataOutcome.aCase.stringId; - if (!Object.keys(changedFieldsMap).includes(caseId)) { + if (!Object.keys(changedFieldsMap)?.includes(caseId)) { changedFieldsMap[caseId] = {}; } const taskId = setDataOutcome.task.stringId; - if (!Object.keys(changedFieldsMap[caseId]).includes(taskId)) { + if (!Object.keys(changedFieldsMap[caseId])?.includes(taskId)) { changedFieldsMap[caseId][taskId] = { taskId }; } Object.keys(outcomeChangedFields).forEach(fieldId => { - if (Object.keys(changedFieldsMap[caseId][taskId]).includes(fieldId)) { + if (Object.keys(changedFieldsMap[caseId][taskId])?.includes(fieldId)) { Object.keys(outcomeChangedFields[fieldId]).forEach(attribute => { changedFieldsMap[caseId][taskId][fieldId][attribute] = outcomeChangedFields[fieldId][attribute]; }); diff --git a/projects/netgrif-components-core/src/lib/header/services/overflow.service.ts b/projects/netgrif-components-core/src/lib/header/services/overflow.service.ts index 09c358b2fa..ec5f982a61 100644 --- a/projects/netgrif-components-core/src/lib/header/services/overflow.service.ts +++ b/projects/netgrif-components-core/src/lib/header/services/overflow.service.ts @@ -86,7 +86,7 @@ export class OverflowService { const item = localStorage.getItem(viewId + '-' + id); if (item !== null) { - if (id.includes('columnCount')) { + if (id?.includes('columnCount')) { this._initializedCount = true; } return item; diff --git a/projects/netgrif-components-core/src/lib/logger/services/log-publisher.service.ts b/projects/netgrif-components-core/src/lib/logger/services/log-publisher.service.ts index 829b090abc..cbf93d7acf 100644 --- a/projects/netgrif-components-core/src/lib/logger/services/log-publisher.service.ts +++ b/projects/netgrif-components-core/src/lib/logger/services/log-publisher.service.ts @@ -28,7 +28,7 @@ export class LogPublisherService implements OnDestroy { this._publishers = []; const serviceConfig = config.get().services; if (serviceConfig && serviceConfig.log && serviceConfig.log.publishers) { - Object.keys(PUBLISHERS).filter(p => serviceConfig.log.publishers.includes(p) && PUBLISHERS[p]) + Object.keys(PUBLISHERS).filter(p => serviceConfig.log.publishers?.includes(p) && PUBLISHERS[p]) .forEach(key => new PUBLISHERS[key](this)); } } diff --git a/projects/netgrif-components-core/src/lib/navigation/navigation-double-drawer/abstract-navigation-double-drawer.ts b/projects/netgrif-components-core/src/lib/navigation/navigation-double-drawer/abstract-navigation-double-drawer.ts index 62769e8bcf..d8b1790208 100644 --- a/projects/netgrif-components-core/src/lib/navigation/navigation-double-drawer/abstract-navigation-double-drawer.ts +++ b/projects/netgrif-components-core/src/lib/navigation/navigation-double-drawer/abstract-navigation-double-drawer.ts @@ -364,7 +364,7 @@ export abstract class AbstractNavigationDoubleDrawerComponent implements OnInit, }, error => { this._log.error(error); }); - } else if (!path.includes(this.currentNode.uriPath)) { + } else if (!path?.includes(this.currentNode.uriPath)) { this._uriService.activeNode = this._currentNode.parent; this.itemClicked.emit({uriNode: this._uriService.activeNode, isHome: false}); } else { 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 eedeff76f9..9b6c2f1b96 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 @@ -155,7 +155,7 @@ export abstract class AbstractTaskPanelComponent extends AbstractPanelWithImmedi }); this._subTaskData = _changedFieldsService.changedFields$.subscribe((changedFieldsMap: ChangedFieldsMap) => { const filteredCaseIds: Array = Object.keys(changedFieldsMap).filter( - caseId => Object.keys(this._taskContentService.referencedTaskAndCaseIds).includes(caseId) + caseId => Object.keys(this._taskContentService.referencedTaskAndCaseIds)?.includes(caseId) ); const changedFields: Array = []; filteredCaseIds.forEach(caseId => { diff --git a/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts b/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts index c1668485d4..ad49b100cc 100644 --- a/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts +++ b/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts @@ -49,12 +49,12 @@ export abstract class AbstractResourceProvider { public static sanitizeUrl(endpoint?: string, url?: string): string { - if (endpoint.includes('http://') || (endpoint.includes('https://'))) { + if (endpoint?.includes('http://') || (endpoint?.includes('https://'))) { if (url) { - if (endpoint.includes(url)) { + if (endpoint?.includes(url)) { return endpoint; } else { - return url.includes('https://') ? 'https://' + + return url?.includes('https://') ? 'https://' + endpoint.replace(/(^\w+:|^)\/\//, '') : 'http://' + endpoint.replace(/(^\w+:|^)\/\//, ''); } diff --git a/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts b/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts index 38dfd64805..bfedb0dd36 100644 --- a/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts +++ b/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts @@ -85,7 +85,7 @@ export class RedirectService { public parseRedirectPath(url: string): string { let path: string; - if (url.includes('?')) { + if (url?.includes('?')) { path = url.slice(0, url.indexOf('?')); } else { path = url; diff --git a/projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts b/projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts index 909d5a75ac..3f8202c32a 100644 --- a/projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts +++ b/projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts @@ -320,7 +320,7 @@ export class CaseDataset extends Category implements AutocompleteOpti .filter(immediateData => { return immediateData.title !== undefined && immediateData.title.trim().length > 0 - && !CaseDataset.DISABLED_TYPES.includes(immediateData.type); + && !CaseDataset.DISABLED_TYPES?.includes(immediateData.type); }) .forEach(immediateData => { let type = immediateData.type; diff --git a/projects/netgrif-components-core/src/lib/search/models/operator/operator.ts b/projects/netgrif-components-core/src/lib/search/models/operator/operator.ts index a5c154abc0..4c5487d04d 100644 --- a/projects/netgrif-components-core/src/lib/search/models/operator/operator.ts +++ b/projects/netgrif-components-core/src/lib/search/models/operator/operator.ts @@ -104,7 +104,7 @@ export abstract class Operator { * @param forceWrap if set to `true` the value will be wrapped regardless of it's content */ public static wrapInputWithQuotes(input: string, forceWrap = false): WrapResult { - if (typeof input === 'string' && (input.includes(' ') || forceWrap)) + if (typeof input === 'string' && (input?.includes(' ') || forceWrap)) return {value: `"${input}"`, wasWrapped: true}; else return {value: input, wasWrapped: false}; diff --git a/projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts b/projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts index 58d2db77fe..425cc315da 100644 --- a/projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts +++ b/projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts @@ -48,7 +48,7 @@ describe('AbstractMultiUserAssignListComponent', () => { it('should select', () => { component.select({id: '0'} as UserListItem) - expect(component.currentlySelectedUsers.includes('0')).toBeTruthy(); + expect(component.currentlySelectedUsers?.includes('0')).toBeTruthy(); }); it('should get loading', () => { diff --git a/projects/netgrif-components-core/src/lib/task-content/model/subgrid.spec.ts b/projects/netgrif-components-core/src/lib/task-content/model/subgrid.spec.ts index c3e20d4c47..db12bf57c4 100644 --- a/projects/netgrif-components-core/src/lib/task-content/model/subgrid.spec.ts +++ b/projects/netgrif-components-core/src/lib/task-content/model/subgrid.spec.ts @@ -26,12 +26,12 @@ describe('Subgrid', () => { expect(titleElement.title).toBe('title'); expect(titleElement.type).toBe(TaskElementType.DATA_GROUP_TITLE); - expect(titleElement.gridAreaId.includes('group')).toBeTrue(); + expect(titleElement.gridAreaId?.includes('group')).toBeTrue(); const field = createMockField(true, {x: 0, y: 0, rows: 1, cols: 2}, 'field'); const fieldElement = subgrid.addField(field, FieldTypeResource.BOOLEAN); - expect(fieldElement.gridAreaId.includes('field')).toBeTrue(); + expect(fieldElement.gridAreaId?.includes('field')).toBeTrue(); expect(fieldElement.item).toBe(field); }); @@ -77,7 +77,7 @@ describe('Subgrid', () => { subgrid.addRow(['', '', '']); } catch (e) { thrown = true; - expect(e.message.includes(JSON.stringify(['', '', '']))).toBeTrue(); + expect(e.message?.includes(JSON.stringify(['', '', '']))).toBeTrue(); } expect(thrown).toBeTrue(); diff --git a/projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts b/projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts index aec119d6ee..3800528065 100644 --- a/projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts +++ b/projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts @@ -42,7 +42,7 @@ export class FieldConverterService { return new BooleanField(item.stringId, item.name, item.value as boolean, item.behavior, item.placeholder, item.description, item.layout, item.validations, item.component, item.parentTaskId); case FieldTypeResource.TEXT: - if (this.textFieldNames.includes(item.component?.name)) { + if (this.textFieldNames?.includes(item.component?.name)) { return new TextAreaField(item.stringId, item.name, this.resolveTextValue(item, item.value), item.behavior, item.placeholder, item.description, item.layout, item.validations, item.component, item.parentTaskId); } diff --git a/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts b/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts index cdf3857d5c..a28e54cf55 100644 --- a/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts +++ b/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts @@ -305,12 +305,12 @@ export abstract class TaskContentService implements OnDestroy { protected getReferencedTaskId(changedField: string, chFields: ChangedFields): string { return !!this.taskFieldsIndex ? - (Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && taskId === chFields.taskId && Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField)) - || Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField))) : undefined; + (Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && taskId === chFields.taskId && Object.keys(this.taskFieldsIndex[taskId].fields)?.includes(changedField)) + || Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && Object.keys(this.taskFieldsIndex[taskId].fields)?.includes(changedField))) : undefined; } protected findTaskRefId(taskId: string, fields: { [fieldId: string]: DataField}): DataField { - let taskRefId = Object.values(fields).find(f => f instanceof TaskRefField && f.value.includes(taskId)); + let taskRefId = Object.values(fields).find(f => f instanceof TaskRefField && f.value?.includes(taskId)); if (!taskRefId) { const referencedTaskIds = Object.values(fields).filter(f => f instanceof TaskRefField).map(tr => tr.value); referencedTaskIds.forEach(id => { diff --git a/projects/netgrif-components-core/src/lib/task/services/task-data.service.ts b/projects/netgrif-components-core/src/lib/task/services/task-data.service.ts index 73b3b00af6..5dca32a15d 100644 --- a/projects/netgrif-components-core/src/lib/task/services/task-data.service.ts +++ b/projects/netgrif-components-core/src/lib/task/services/task-data.service.ts @@ -186,7 +186,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy { } } else if (dataGroupParentCaseId === this._safeTask.caseId && parentTaskId !== this._safeTask.stringId - && !this._taskContentService.referencedTaskAndCaseIds[dataGroupParentCaseId].includes(parentTaskId)) { + && !this._taskContentService.referencedTaskAndCaseIds[dataGroupParentCaseId]?.includes(parentTaskId)) { this._taskContentService.referencedTaskAndCaseIds[dataGroupParentCaseId].push(group.parentTaskId); } if (group.fields.length > 0 && !this._taskContentService.taskFieldsIndex[parentTaskId]) { @@ -375,7 +375,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy { } const taskIdsInRequest: Array = Object.keys(request); for (const taskId of taskIdsInRequest) { - if (!Object.keys(this._taskContentService.taskFieldsIndex).includes(taskId)) { + if (!Object.keys(this._taskContentService.taskFieldsIndex)?.includes(taskId)) { this._log.error(`Task id ${taskId} is not present in task fields index`); return false; } @@ -617,7 +617,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy { protected revertToPreviousValue(context: TaskSetDataRequestContext): void { this._safeTask.dataGroups.forEach(dataGroup => { dataGroup.fields.forEach(field => { - if (field.initialized && field.valid && Object.keys(context.previousValues).includes(field.stringId)) { + if (field.initialized && field.valid && Object.keys(context.previousValues)?.includes(field.stringId)) { field.revertToPreviousValue(); } }); diff --git a/projects/netgrif-components-core/src/lib/user/services/user-comparator.service.ts b/projects/netgrif-components-core/src/lib/user/services/user-comparator.service.ts index e422b6cb2d..b312784a29 100644 --- a/projects/netgrif-components-core/src/lib/user/services/user-comparator.service.ts +++ b/projects/netgrif-components-core/src/lib/user/services/user-comparator.service.ts @@ -12,6 +12,6 @@ export class UserComparatorService { public compareUsers(user: IUser, acceptImpersonator: boolean = true): boolean { const loggedUser = acceptImpersonator ? this._userService.user.getSelfOrImpersonated() : this._userService.user; return user.email === loggedUser.email || - user.email.includes('anonymous') && this._userService.user.email.includes('anonymous'); + user.email?.includes('anonymous') && this._userService.user.email?.includes('anonymous'); } } diff --git a/projects/netgrif-components-core/src/lib/utility/contains.pipe.ts b/projects/netgrif-components-core/src/lib/utility/contains.pipe.ts index ed2b5719a9..97e21adabe 100644 --- a/projects/netgrif-components-core/src/lib/utility/contains.pipe.ts +++ b/projects/netgrif-components-core/src/lib/utility/contains.pipe.ts @@ -7,7 +7,7 @@ export class ContainsPipe implements PipeTransform { transform(value: Array | Set | Map, toCheck: unknown): boolean { if (value === null || value === undefined) return false; - if (Array.isArray(value)) return value.includes(toCheck); + if (Array.isArray(value)) return value?.includes(toCheck); if (value instanceof Set || value instanceof Map) return value.has(toCheck); return false; } diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts index 9eb86c067f..7b94efc89b 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts @@ -1,4 +1,4 @@ -import {AfterViewInit, Component, Inject, OnInit, ViewChild} from '@angular/core'; +import {Component, Inject, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {AsyncPipe} from "@angular/common"; import {combineLatest} from "rxjs"; @@ -29,7 +29,6 @@ import { NAE_BASE_FILTER, BaseFilter, } from '@netgrif/components-core'; -import {HeaderComponent} from "../../../../../header/header.component"; const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, route: ActivatedRoute) => { const array = []; @@ -71,9 +70,7 @@ const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, rout AsyncPipe ] }) -export class DefaultPublicSingleTaskViewComponent extends AbstractSingleTaskViewComponent implements OnInit, AfterViewInit { - - @ViewChild('header') public taskHeaderComponent: HeaderComponent; +export class DefaultPublicSingleTaskViewComponent extends AbstractSingleTaskViewComponent implements OnInit { hidden: boolean; @@ -94,8 +91,4 @@ export class DefaultPublicSingleTaskViewComponent extends AbstractSingleTaskView ngOnInit(): void { this._router.routeReuseStrategy.shouldReuseRoute = () => false } - - ngAfterViewInit(): void { - this.initializeHeader(this.taskHeaderComponent); - } } diff --git a/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.ts b/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.ts index 8ee40014eb..88e777d4d8 100644 --- a/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.ts +++ b/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.ts @@ -45,7 +45,7 @@ export class CasePanelComponent extends AbstractCasePanelComponent implements On ngOnInit() { super.ngOnInit(); if (this._dataFieldPortalData !== null && this._dataFieldPortalData.dataField instanceof MultichoiceField) { - this.approvalFormControl.setValue(this._dataFieldPortalData.dataField.value.includes(this.case_.stringId)); + this.approvalFormControl.setValue(this._dataFieldPortalData.dataField.value?.includes(this.case_.stringId)); this.approvalFormControl.valueChanges.subscribe(value => { if (this._changeValue) { if (value) { @@ -63,7 +63,7 @@ export class CasePanelComponent extends AbstractCasePanelComponent implements On }) this._dataFieldPortalData.dataField.valueChanges().subscribe(() => { this._changeValue = false; - this.approvalFormControl.setValue(this._dataFieldPortalData.dataField.value.includes(this.case_.stringId)); + this.approvalFormControl.setValue(this._dataFieldPortalData.dataField.value?.includes(this.case_.stringId)); }) } if (this._dataFieldPortalData !== null && this._dataFieldPortalData.dataField instanceof EnumerationField) { From 1f490eca28218dbd5a736295deba8bf827a11335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Fri, 31 Jan 2025 12:10:03 +0100 Subject: [PATCH 3/7] [NAE-2038] - Public View - fix tests --- .../components/confirm-dialog/confirm-dialog.component.ts | 2 +- .../navigation/breadcrumbs/abstract-breadcrumbs.component.ts | 2 +- .../src/lib/resources/resource-provider.service.ts | 4 ++-- .../src/lib/routing/redirect-service/redirect.service.ts | 2 +- .../src/lib/search/models/operator/substring.ts | 2 +- .../src/lib/search/search-service/search.service.ts | 2 +- .../src/lib/task-content/model/subgrid.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/dialog/components/confirm-dialog/confirm-dialog.component.ts b/projects/netgrif-components-core/src/lib/dialog/components/confirm-dialog/confirm-dialog.component.ts index 80b15aa92c..09a7db2bf0 100644 --- a/projects/netgrif-components-core/src/lib/dialog/components/confirm-dialog/confirm-dialog.component.ts +++ b/projects/netgrif-components-core/src/lib/dialog/components/confirm-dialog/confirm-dialog.component.ts @@ -30,7 +30,7 @@ export class ConfirmDialogComponent extends AbstractDialogComponent')); + this.parsedContent = sanitizer.bypassSecurityTrustHtml(data.content?.replace('\\n', '
')); } else { this.parsedContent = sanitizer.bypassSecurityTrustHtml(''); } diff --git a/projects/netgrif-components-core/src/lib/navigation/breadcrumbs/abstract-breadcrumbs.component.ts b/projects/netgrif-components-core/src/lib/navigation/breadcrumbs/abstract-breadcrumbs.component.ts index f56c004ba5..baefd84f1e 100644 --- a/projects/netgrif-components-core/src/lib/navigation/breadcrumbs/abstract-breadcrumbs.component.ts +++ b/projects/netgrif-components-core/src/lib/navigation/breadcrumbs/abstract-breadcrumbs.component.ts @@ -158,7 +158,7 @@ export abstract class AbstractBreadcrumbsComponent implements OnDestroy, AfterVi let tmp = ''; return splitPath.filter(s => s !== "").map((value) => { tmp += AbstractBreadcrumbsComponent.DELIMETER + value; - return tmp.replace("//", AbstractBreadcrumbsComponent.DELIMETER) + return tmp?.replace("//", AbstractBreadcrumbsComponent.DELIMETER) }); } diff --git a/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts b/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts index ad49b100cc..e701b42f78 100644 --- a/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts +++ b/projects/netgrif-components-core/src/lib/resources/resource-provider.service.ts @@ -55,8 +55,8 @@ export abstract class AbstractResourceProvider { return endpoint; } else { return url?.includes('https://') ? 'https://' + - endpoint.replace(/(^\w+:|^)\/\//, '') : 'http://' + - endpoint.replace(/(^\w+:|^)\/\//, ''); + endpoint?.replace(/(^\w+:|^)\/\//, '') : 'http://' + + endpoint?.replace(/(^\w+:|^)\/\//, ''); } } else { return endpoint; diff --git a/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts b/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts index bfedb0dd36..f2d34346fd 100644 --- a/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts +++ b/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts @@ -90,6 +90,6 @@ export class RedirectService { } else { path = url; } - return path.replace('/redirect', ''); + return path?.replace('/redirect', ''); } } diff --git a/projects/netgrif-components-core/src/lib/search/models/operator/substring.ts b/projects/netgrif-components-core/src/lib/search/models/operator/substring.ts index 21c771ede8..cd6eff6089 100644 --- a/projects/netgrif-components-core/src/lib/search/models/operator/substring.ts +++ b/projects/netgrif-components-core/src/lib/search/models/operator/substring.ts @@ -16,7 +16,7 @@ export class Substring extends Operator { // TODO IMPROVEMENT 27.4.2020 - we could use regular expressions to search for substrings which would solve the unintuitive // behavior that occurs when we search for strings that contain spaces. We need to escape the input string in a special way // if we choose to do this - const escapedValue = Operator.escapeInput(args[0]).value.replace(/ /g, '\\ '); + const escapedValue = Operator.escapeInput(args[0]).value?.replace(/ /g, '\\ '); return Operator.forEachKeyword(elasticKeywords, keyword => new Query(`(${keyword}:*${escapedValue}*)`)); } diff --git a/projects/netgrif-components-core/src/lib/search/search-service/search.service.ts b/projects/netgrif-components-core/src/lib/search/search-service/search.service.ts index 58272d182a..f9d52fa94b 100644 --- a/projects/netgrif-components-core/src/lib/search/search-service/search.service.ts +++ b/projects/netgrif-components-core/src/lib/search/search-service/search.service.ts @@ -257,7 +257,7 @@ export class SearchService implements OnDestroy { * @param searchedSubstring value that should be searched on all full text fields */ public setFullTextFilter(searchedSubstring: string): void { - const whiteSpacedSubstring = searchedSubstring.replace(/ /g, '\\ '); + const whiteSpacedSubstring = searchedSubstring?.replace(/ /g, '\\ '); this._fullTextFilter = new SimpleFilter('', this._baseFilter.type, {fullText: whiteSpacedSubstring}); this.updateActiveFilter(); } diff --git a/projects/netgrif-components-core/src/lib/task-content/model/subgrid.ts b/projects/netgrif-components-core/src/lib/task-content/model/subgrid.ts index 58b9b5b529..0a72a92cf3 100644 --- a/projects/netgrif-components-core/src/lib/task-content/model/subgrid.ts +++ b/projects/netgrif-components-core/src/lib/task-content/model/subgrid.ts @@ -178,7 +178,7 @@ export class Subgrid { * @returns the base identifier, if it already is unique. A unique variation on the base identifier if it is already in use. */ protected assureUniqueness(identifier: string): string { - const alphaNumIdentifier = 'x' + identifier.replace(/[^0-9a-z]/gi, ''); + const alphaNumIdentifier = 'x' + identifier?.replace(/[^0-9a-z]/gi, ''); if (!this._existingIdentifiers.has(alphaNumIdentifier)) { this._existingIdentifiers.add(alphaNumIdentifier); return alphaNumIdentifier; From eba3081f8fee2292151ed510d65e6c0e06e54230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Fri, 31 Jan 2025 13:44:26 +0100 Subject: [PATCH 4/7] [NAE-2038] - Public View - fix tests --- .../src/lib/routing/redirect-service/redirect.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts b/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts index f2d34346fd..da889e259d 100644 --- a/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts +++ b/projects/netgrif-components-core/src/lib/routing/redirect-service/redirect.service.ts @@ -85,6 +85,9 @@ export class RedirectService { public parseRedirectPath(url: string): string { let path: string; + if (url === undefined || url === null) { + return ''; + } if (url?.includes('?')) { path = url.slice(0, url.indexOf('?')); } else { From 02f463d466b69a32263a5c976d53abcae7433401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Mon, 10 Feb 2025 09:44:57 +0100 Subject: [PATCH 5/7] =?UTF-8?q?[NAE-2035]=20-=20Single-Task-View=20v=20int?= =?UTF-8?q?ernej=20=C4=8Dasti=20aplik=C3=A1cie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add single task view and tabbed single task view to default components - add directories --- .../public-single-task-view.component.ts | 12 +-- .../tabbed-views-example.component.ts | 5 +- .../src/assets/i18n/de.json | 3 +- .../src/assets/i18n/en.json | 3 +- .../src/assets/i18n/sk.json | 3 +- .../src/lib/view/public-api.ts | 1 + .../abstract-single-task-view.component.ts | 39 ++------ ...tract-tabbed-single-task-view.component.ts | 29 ++++++ .../case-ref-default.component.spec.ts | 2 +- .../case-ref-default.component.ts | 2 +- ...numeration-caseref-field.component.spec.ts | 2 +- .../enumeration-caseref-field.component.ts | 2 +- ...ultichoice-caseref-field.component.spec.ts | 2 +- .../multichoice-caseref-field.component.ts | 2 +- .../task-ref-list-field.component.ts | 2 +- .../task-view-dialog.component.ts | 3 +- ...fault-public-single-task-view.component.ts | 12 +-- .../default-case-ref-list-view.component.html | 0 .../default-case-ref-list-view.component.scss | 0 ...fault-case-ref-list-view.component.spec.ts | 6 +- .../default-case-ref-list-view.component.ts | 8 +- .../default-task-view.component.html | 0 .../default-task-view.component.scss | 0 .../default-task-view.component.spec.ts | 2 +- .../default-task-view.component.ts | 4 +- .../default-simple-task-view.component.html | 0 .../default-simple-task-view.component.scss | 0 ...default-simple-task-view.component.spec.ts | 4 +- .../default-simple-task-view.component.ts | 4 +- .../default-single-task-view.component.html | 13 +++ .../default-single-task-view.component.scss | 0 ...default-single-task-view.component.spec.ts | 25 +++++ .../default-single-task-view.component.ts | 74 ++++++++++++++ .../default-tab-view.component.html | 0 .../default-tab-view.component.scss | 0 .../default-tab-view.component.spec.ts | 4 +- .../default-tab-view.component.ts | 2 +- .../default-tabbed-case-view.component.html | 0 .../default-tabbed-case-view.component.scss | 0 ...default-tabbed-case-view.component.spec.ts | 4 +- .../default-tabbed-case-view.component.ts | 8 +- ...ult-tabbed-single-task-view.component.html | 17 ++++ ...ult-tabbed-single-task-view.component.scss | 0 ...-tabbed-single-task-view.component.spec.ts | 25 +++++ ...fault-tabbed-single-task-view.component.ts | 97 +++++++++++++++++++ .../default-tabbed-task-view.component.html | 0 .../default-tabbed-task-view.component.scss | 0 ...default-tabbed-task-view.component.spec.ts | 4 +- .../default-tabbed-task-view.component.ts | 6 +- ...p-navigation-component-resolver.service.ts | 2 +- .../src/lib/navigation/navigation.module.ts | 21 ++-- .../src/lib/navigation/public-api.ts | 12 ++- 52 files changed, 365 insertions(+), 101 deletions(-) create mode 100644 projects/netgrif-components-core/src/lib/view/task-view/abstract-tabbed-single-task-view.component.ts rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-case-ref-list-view/default-case-ref-list-view.component.html (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-case-ref-list-view/default-case-ref-list-view.component.scss (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts (92%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-case-ref-list-view/default-case-ref-list-view.component.ts (93%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-task-view/default-task-view.component.html (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-task-view/default-task-view.component.scss (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-task-view/default-task-view.component.spec.ts (95%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => refs}/default-task-view/default-task-view.component.ts (93%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => simple-views}/default-simple-task-view/default-simple-task-view.component.html (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => simple-views}/default-simple-task-view/default-simple-task-view.component.scss (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => simple-views}/default-simple-task-view/default-simple-task-view.component.spec.ts (95%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => simple-views}/default-simple-task-view/default-simple-task-view.component.ts (95%) create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.html create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.scss create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.ts rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tab-view/default-tab-view.component.html (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tab-view/default-tab-view.component.scss (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tab-view/default-tab-view.component.spec.ts (98%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tab-view/default-tab-view.component.ts (99%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-case-view/default-tabbed-case-view.component.html (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-case-view/default-tabbed-case-view.component.scss (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts (97%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-case-view/default-tabbed-case-view.component.ts (97%) create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component.html create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component.scss create mode 100644 projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component.spec.ts create mode 100644 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 rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-task-view/default-tabbed-task-view.component.html (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-task-view/default-tabbed-task-view.component.scss (100%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts (96%) rename projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/{ => tabbed}/default-tabbed-task-view/default-tabbed-task-view.component.ts (95%) diff --git a/projects/nae-example-app/src/app/doc/public-single-task-view/public-single-task-view.component.ts b/projects/nae-example-app/src/app/doc/public-single-task-view/public-single-task-view.component.ts index f140631fa8..86512dc232 100644 --- a/projects/nae-example-app/src/app/doc/public-single-task-view/public-single-task-view.component.ts +++ b/projects/nae-example-app/src/app/doc/public-single-task-view/public-single-task-view.component.ts @@ -1,4 +1,4 @@ -import {AfterViewInit, Component, Inject, OnInit, ViewChild} from '@angular/core'; +import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; import { AbstractSingleTaskViewComponent, AllowedNetsService, @@ -22,9 +22,7 @@ import { TaskRequestStateService, TaskResourceServiceProvider, TaskViewService, - ViewIdService, - BaseFilter, - NAE_BASE_FILTER + ViewIdService } from '@netgrif/components-core'; import {ActivatedRoute, Router} from '@angular/router'; import {combineLatest} from 'rxjs'; @@ -60,7 +58,6 @@ const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, rout deps: [AllowedNetsServiceFactory, ActivatedRoute] }, {provide: NAE_VIEW_ID_SEGMENT, useValue: 'publicTaskView'}, - {provide: AllowedNetsServiceFactory, useClass: AllowedNetsServiceFactory}, ViewIdService, {provide: TaskContentService, useClass: SingleTaskContentService}, TaskDataService, @@ -81,9 +78,8 @@ export class PublicSingleTaskViewComponent extends AbstractSingleTaskViewCompone constructor(taskViewService: TaskViewService, publicTaskLoadingService: PublicTaskLoadingService, activatedRoute: ActivatedRoute, - protected _router: Router, - @Inject(NAE_BASE_FILTER) baseFilter: BaseFilter) { - super(taskViewService, activatedRoute, baseFilter); + protected _router: Router) { + super(taskViewService, activatedRoute); this.hidden = false; this.loading$ = combineLatest(taskViewService.loading$, publicTaskLoadingService.loading$).pipe( map(sources => { diff --git a/projects/nae-example-app/src/app/doc/tabbed-case-view/tabbed-views-example.component.ts b/projects/nae-example-app/src/app/doc/tabbed-case-view/tabbed-views-example.component.ts index cac2c7c678..cd25a091e3 100644 --- a/projects/nae-example-app/src/app/doc/tabbed-case-view/tabbed-views-example.component.ts +++ b/projects/nae-example-app/src/app/doc/tabbed-case-view/tabbed-views-example.component.ts @@ -3,6 +3,9 @@ import {NAE_TASK_FORCE_OPEN, NAE_VIEW_ID_SEGMENT, TabContent, ViewIdService} fro import {TabbedCaseViewComponent} from './tabbed-case-view/tabbed-case-view.component'; import {TabbedTaskViewComponent} from './tabbed-task-view/tabbed-task-view.component'; import {ReplaySubject} from 'rxjs'; +import { + DefaultTabbedSingleTaskViewComponent +} from "@netgrif/components"; @Component({ selector: 'nae-app-tabbed-views-example', @@ -32,7 +35,7 @@ export class TabbedViewsExampleComponent implements OnInit { canBeClosed: false, tabContentComponent: TabbedCaseViewComponent, injectedObject: { - tabViewComponent: TabbedTaskViewComponent, + tabViewComponent: DefaultTabbedSingleTaskViewComponent, tabViewOrder: 0, exampleUseCache: true } diff --git a/projects/netgrif-components-core/src/assets/i18n/de.json b/projects/netgrif-components-core/src/assets/i18n/de.json index a8f7aa7ba6..69fab0a14f 100644 --- a/projects/netgrif-components-core/src/assets/i18n/de.json +++ b/projects/netgrif-components-core/src/assets/i18n/de.json @@ -49,7 +49,8 @@ "finish": "Abschließen", "cancel": "Stornieren", "noData": "Diese Aufgabe hat keine Dateien. Schließen Sie die Aufgabe ab, um fortzufahren.", - "redirecting": "Umleiten..." + "redirecting": "Umleiten...", + "closeTab": "Schließen" }, "footer": { "defaultText": "NETGRIF, s.r.o. © 2022" diff --git a/projects/netgrif-components-core/src/assets/i18n/en.json b/projects/netgrif-components-core/src/assets/i18n/en.json index d2bbf05e8d..aec25b81a6 100644 --- a/projects/netgrif-components-core/src/assets/i18n/en.json +++ b/projects/netgrif-components-core/src/assets/i18n/en.json @@ -49,7 +49,8 @@ "finish": "Finish", "cancel": "Cancel", "noData": "This task has no data. Finish to continue.", - "redirecting": "Redirecting..." + "redirecting": "Redirecting...", + "closeTab": "Close" }, "footer": { "defaultText": "NETGRIF, s.r.o. © 2022" diff --git a/projects/netgrif-components-core/src/assets/i18n/sk.json b/projects/netgrif-components-core/src/assets/i18n/sk.json index e47da7ff94..9e1a3a24e0 100644 --- a/projects/netgrif-components-core/src/assets/i18n/sk.json +++ b/projects/netgrif-components-core/src/assets/i18n/sk.json @@ -49,7 +49,8 @@ "finish": "Dokončiť", "cancel": "Zrušiť", "noData": "Táto úloha nemá žiadne údaje. Stlačte dokončiť pre pokračovanie.", - "redirecting": "Presmerovanie..." + "redirecting": "Presmerovanie...", + "closeTab": "Zavrieť" }, "footer": { "defaultText": "NETGRIF, s.r.o. © 2022" 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 0440ef1a5c..1dbd20e931 100644 --- a/projects/netgrif-components-core/src/lib/view/public-api.ts +++ b/projects/netgrif-components-core/src/lib/view/public-api.ts @@ -58,3 +58,4 @@ export * from './tree-case-view/tree-component/add-child-node/abstract-add-child export * from './tree-case-view/tree-component/remove-node/abstract-remove-node.component'; 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'; 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 4486f727ff..12390c9b63 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,64 +1,43 @@ -import {Component, EventEmitter, Inject, Input, OnDestroy, Output} from '@angular/core'; +import {Component, EventEmitter, Input, Output} from '@angular/core'; import {AbstractViewWithHeadersComponent} from '../abstract/view-with-headers'; -import {Observable, Subscription} from 'rxjs'; +import {Observable} from 'rxjs'; import {TaskPanelData} from '../../panel/task-panel-list/task-panel-data/task-panel-data'; import {TaskViewService} from './service/task-view.service'; import {ActivatedRoute} from '@angular/router'; -import {BaseFilter} from "../../search/models/base-filter"; -import {SimpleFilter} from "../../filter/models/simple-filter"; -import {TaskSearchRequestBody} from "../../filter/models/task-search-request-body"; -import {NAE_BASE_FILTER} from "../../search/models/base-filter-injection-token"; import {map, tap} from "rxjs/operators"; +import {AssignPolicy} from "../../task-content/model/policy"; @Component({ selector: 'ncc-abstract-single-task-view', template: '' }) -export abstract class AbstractSingleTaskViewComponent extends AbstractViewWithHeadersComponent implements OnDestroy { +export abstract class AbstractSingleTaskViewComponent extends AbstractViewWithHeadersComponent { @Input() initiallyExpanded: boolean = true; @Input() preventCollapse: boolean = true; @Output() noTaskPresent: EventEmitter; public taskPanelData: Observable; public loading$: Observable; - protected transitionId: string; - protected subRoute: Subscription | undefined; - protected subPanelData: Subscription | undefined; - protected subLoading: Subscription | undefined; + protected finishTitle: string | undefined; protected constructor(protected taskViewService: TaskViewService, - activatedRoute: ActivatedRoute, - @Inject(NAE_BASE_FILTER) protected baseFilter: BaseFilter) { + activatedRoute: ActivatedRoute) { super(taskViewService, activatedRoute); this.noTaskPresent = new EventEmitter(); this.taskPanelData = this.taskViewService.tasks$.pipe( - map(tasks => tasks.find( - panelData => this.isTaskMatchingFilter(panelData, (baseFilter.filter as SimpleFilter).getRequestBody()))) - ).pipe( + map(tasks => tasks?.length > 0 ? tasks[0] : undefined), tap(panelData => { if (!!panelData) { panelData.initiallyExpanded = true + panelData.task.assignPolicy = AssignPolicy.auto; + this.finishTitle = panelData.task.finishTitle; } }) ); this.loading$ = this.taskViewService.loading$; } - ngOnDestroy() { - super.ngOnDestroy(); - if (!!this.subRoute) { - this.subRoute.unsubscribe(); - } - if (!!this.subPanelData) { - this.subPanelData.unsubscribe(); - } - } - get task$(): Observable { return this.taskPanelData; } - - protected isTaskMatchingFilter(panelData: TaskPanelData, taskSearchRequestBody: TaskSearchRequestBody): boolean { - return panelData.task.stringId === taskSearchRequestBody.stringId || panelData.task.transitionId === taskSearchRequestBody.transitionId; - } } diff --git a/projects/netgrif-components-core/src/lib/view/task-view/abstract-tabbed-single-task-view.component.ts b/projects/netgrif-components-core/src/lib/view/task-view/abstract-tabbed-single-task-view.component.ts new file mode 100644 index 0000000000..f4b4f235e8 --- /dev/null +++ b/projects/netgrif-components-core/src/lib/view/task-view/abstract-tabbed-single-task-view.component.ts @@ -0,0 +1,29 @@ +import {Component, Inject, Input, OnDestroy} from "@angular/core"; +import {Subscription} from "rxjs"; +import {TaskViewService} from "./service/task-view.service"; +import {NAE_TAB_DATA} from "../../tabs/tab-data-injection-token/tab-data-injection-token"; +import {InjectedTabbedTaskViewData} from "./models/injected-tabbed-task-view-data"; +import {ActivatedRoute} from "@angular/router"; +import {AbstractSingleTaskViewComponent} from "./abstract-single-task-view.component"; + +@Component({ + selector: 'ncc-abstract-tabbed-single-task-view', + template: '' +}) +export abstract class AbstractTabbedSingleTaskViewComponent extends AbstractSingleTaskViewComponent implements OnDestroy { + protected subTaskView: Subscription; + + protected constructor(taskViewService: TaskViewService, + @Inject(NAE_TAB_DATA) protected _injectedTabData: InjectedTabbedTaskViewData, + _activatedRoute?: ActivatedRoute) { + super(taskViewService, _activatedRoute); + this.subTaskView = taskViewService.closeTab.subscribe(() => { + _injectedTabData.tabViewRef.closeTabIndex(_injectedTabData.tabViewRef.currentlySelectedTab()); + }); + } + + ngOnDestroy(): void { + super.ngOnDestroy(); + this.subTaskView.unsubscribe(); + } +} diff --git a/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.spec.ts b/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.spec.ts index 8e3fbda92c..9d953b8eff 100644 --- a/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.spec.ts +++ b/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.spec.ts @@ -16,7 +16,7 @@ import {RouterTestingModule} from '@angular/router/testing'; import {of} from 'rxjs'; import { DefaultTabbedTaskViewComponent -} from '../../../navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component'; +} from '../../../navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; import {Component} from '@angular/core'; describe('CaseRefDefaultComponent', () => { diff --git a/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.ts b/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.ts index 8ab3d0a3bd..93a85ecf45 100644 --- a/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.ts +++ b/projects/netgrif-components/src/lib/data-fields/case-ref-field/case-ref-default/case-ref-default.component.ts @@ -7,7 +7,7 @@ import { } from '@netgrif/components-core'; import { DefaultCaseRefListViewComponent -} from '../../../navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component'; +} from '../../../navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component'; @Component({ selector: 'nc-case-ref-default', diff --git a/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts b/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts index 0e2ed3b387..06fa1276eb 100644 --- a/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts +++ b/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts @@ -13,7 +13,7 @@ import {RouterTestingModule} from '@angular/router/testing'; import {of} from 'rxjs'; import { DefaultTabbedTaskViewComponent -} from '../../../navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component'; +} from '../../../navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; import {Component} from '@angular/core'; describe('EnumerationCaserefFieldComponent', () => { diff --git a/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.ts b/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.ts index a1392d0a6f..8540ac8ad4 100644 --- a/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.ts +++ b/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.ts @@ -6,7 +6,7 @@ import { } from '@netgrif/components-core'; import { DefaultCaseRefListViewComponent -} from '../../../navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component'; +} from '../../../navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component'; @Component({ selector: 'nc-enumeration-caseref-field', diff --git a/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts b/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts index d9bcb0d157..9ba6733e12 100644 --- a/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts +++ b/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts @@ -13,7 +13,7 @@ import {RouterTestingModule} from '@angular/router/testing'; import {of} from 'rxjs'; import { DefaultTabbedTaskViewComponent -} from '../../../navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component'; +} from '../../../navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; import {Component} from '@angular/core'; describe('MultichoiceCaserefFieldComponent', () => { diff --git a/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.ts b/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.ts index e5bb941de2..15dbd7c390 100644 --- a/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.ts +++ b/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.ts @@ -7,7 +7,7 @@ import { } from '@netgrif/components-core'; import { DefaultCaseRefListViewComponent -} from '../../../navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component'; +} from '../../../navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component'; @Component({ selector: 'nc-multichoice-caseref-field', diff --git a/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.ts b/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.ts index 6fc6fca31d..8280803025 100644 --- a/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.ts +++ b/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.ts @@ -7,7 +7,7 @@ import { } from "@netgrif/components-core"; import { DefaultTaskViewComponent -} from "../../../navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component"; +} from "../../../navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component"; @Component({ selector: 'nc-task-ref-list-field', diff --git a/projects/netgrif-components/src/lib/dialog/task-view-dialog/task-view-dialog.component.ts b/projects/netgrif-components/src/lib/dialog/task-view-dialog/task-view-dialog.component.ts index 82a5c37f56..1cd01c5a0b 100644 --- a/projects/netgrif-components/src/lib/dialog/task-view-dialog/task-view-dialog.component.ts +++ b/projects/netgrif-components/src/lib/dialog/task-view-dialog/task-view-dialog.component.ts @@ -61,9 +61,8 @@ export class TaskViewDialogComponent extends AbstractSingleTaskViewComponent imp protected _userFilterService: UserFiltersService, protected _log: LoggerService, taskViewService: TaskViewService, - @Inject(NAE_BASE_FILTER) baseFilter: BaseFilter, _activatedRoute?: ActivatedRoute) { - super(taskViewService, _activatedRoute, baseFilter); + super(taskViewService, _activatedRoute); if (this._data) { this._injectedData = this._data as TaskViewInjectionData; } diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts index 7b94efc89b..09060ac0ec 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/public/default-public-single-task-view/default-public-single-task-view.component.ts @@ -1,4 +1,4 @@ -import {Component, Inject, OnInit} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {AsyncPipe} from "@angular/common"; import {combineLatest} from "rxjs"; @@ -25,9 +25,7 @@ import { TaskEventService, NAE_TASK_OPERATIONS, SubjectTaskOperations, - AbstractSingleTaskViewComponent, - NAE_BASE_FILTER, - BaseFilter, + AbstractSingleTaskViewComponent } from '@netgrif/components-core'; const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, route: ActivatedRoute) => { @@ -58,7 +56,6 @@ const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, rout deps: [AllowedNetsServiceFactory, ActivatedRoute] }, {provide: NAE_VIEW_ID_SEGMENT, useValue: 'publicTaskView'}, - {provide: AllowedNetsServiceFactory, useClass: AllowedNetsServiceFactory}, ViewIdService, {provide: TaskContentService, useClass: SingleTaskContentService}, TaskDataService, @@ -77,9 +74,8 @@ export class DefaultPublicSingleTaskViewComponent extends AbstractSingleTaskView constructor(taskViewService: TaskViewService, publicTaskLoadingService: PublicTaskLoadingService, activatedRoute: ActivatedRoute, - protected _router: Router, - @Inject(NAE_BASE_FILTER) baseFilter: BaseFilter) { - super(taskViewService, activatedRoute, baseFilter); + protected _router: Router) { + super(taskViewService, activatedRoute); this.hidden = false; this.loading$ = combineLatest(taskViewService.loading$, publicTaskLoadingService.loading$).pipe( map(sources => { diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.html similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.html rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.html diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.scss rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.scss diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts similarity index 92% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts index 9063799991..57748728ec 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DefaultCaseRefListViewComponent } from './default-case-ref-list-view.component'; -import {NavigationComponentModule} from '../../../navigation.module'; +import {NavigationComponentModule} from '../../../../navigation.module'; import { FilterField, FilterType, NAE_TAB_DATA, @@ -10,11 +10,11 @@ import { TestMockDependenciesModule, UserFilterConstants, NAE_BASE_FILTER, SimpleFilter -} from '@netgrif/components-core'; +} from 'netgrif-components-core'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {RouterTestingModule} from '@angular/router/testing'; import {of} from 'rxjs'; -import {DefaultTabbedTaskViewComponent} from '../default-tabbed-task-view/default-tabbed-task-view.component'; +import {DefaultTabbedTaskViewComponent} from '../../tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; describe('DefaultCaseRefListViewComponent', () => { let component: DefaultCaseRefListViewComponent; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts similarity index 93% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts index 15a5eeb36f..14f88b5a72 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts @@ -20,12 +20,12 @@ import { SimpleFilter, TaskSetDataRequestFields, ViewIdService, DATA_FIELD_PORTAL_DATA, DataFieldPortalData, MultichoiceField, EnumerationField -} from '@netgrif/components-core'; -import {HeaderComponent} from '../../../../header/header.component' -import {DefaultTabbedTaskViewComponent} from '../default-tabbed-task-view/default-tabbed-task-view.component'; +} from 'netgrif-components-core'; +import {HeaderComponent} from '../../../../../header/header.component' +import {DefaultTabbedTaskViewComponent} from '../../tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; import { InjectedTabbedTaskViewDataWithNavigationItemTaskData -} from "../model/injected-tabbed-task-view-data-with-navigation-item-task-data"; +} from "../../model/injected-tabbed-task-view-data-with-navigation-item-task-data"; const localAllowedNetsFactory = (factory: AllowedNetsServiceFactory) => { return factory.createWithAllNets(); diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.html similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.html rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.html diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.scss rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.scss diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.spec.ts similarity index 95% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.spec.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.spec.ts index a67188fb0d..bf3663455e 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.spec.ts @@ -1,7 +1,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {DefaultTaskViewComponent} from './default-task-view.component'; -import {NavigationComponentModule} from "../../../navigation.module"; +import {NavigationComponentModule} from "../../../../navigation.module"; import {NAE_BASE_FILTER, NAE_VIEW_ID_SEGMENT, SimpleFilter, TestMockDependenciesModule} from "netgrif-components-core"; import {NoopAnimationsModule} from "@angular/platform-browser/animations"; import {RouterTestingModule} from "@angular/router/testing"; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts similarity index 93% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts index 15c23f1963..7602eb4983 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-task-view/default-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts @@ -10,8 +10,8 @@ import { SearchService, TaskEventNotification, TaskViewService, ViewIdService -} from "@netgrif/components-core"; -import {HeaderComponent} from "../../../../header/header.component"; +} from "netgrif-components-core"; +import {HeaderComponent} from "../../../../../header/header.component"; const localAllowedNetsFactory = (factory: AllowedNetsServiceFactory) => { return factory.createWithAllNets(); diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.html similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.html rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.html diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.scss rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.scss diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.spec.ts similarity index 95% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.spec.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.spec.ts index 0856dddbc0..755f5f9d55 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.spec.ts @@ -1,13 +1,13 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {DefaultSimpleTaskViewComponent} from './default-simple-task-view.component'; -import {NavigationComponentModule} from '../../../navigation.module'; +import {NavigationComponentModule} from '../../../../navigation.module'; import { FilterField, FilterType, NAE_NAVIGATION_ITEM_TASK_DATA, OverflowService, TestMockDependenciesModule, UserFilterConstants -} from '@netgrif/components-core'; +} from 'netgrif-components-core'; import {RouterModule} from '@angular/router'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.ts similarity index 95% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.ts index bb16a9b054..1d8de6264f 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.ts @@ -18,8 +18,8 @@ import { CategoryResolverService, NAE_DEFAULT_CASE_SEARCH_CATEGORIES, NAE_DEFAULT_TASK_SEARCH_CATEGORIES, BaseAllowedNetsService, FilterExtractionService, ChangedFieldsService -} from '@netgrif/components-core'; -import {HeaderComponent} from '../../../../header/header.component'; +} from 'netgrif-components-core'; +import {HeaderComponent} from '../../../../../header/header.component'; import {ActivatedRoute} from '@angular/router'; @Component({ diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.html new file mode 100644 index 0000000000..bfd9194834 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.html @@ -0,0 +1,13 @@ +
+
+ +
+
+ + + + + diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts new file mode 100644 index 0000000000..2f467e6d73 --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DefaultSingleTaskViewComponent } from './default-single-task-view.component'; + +describe('DefaultSingleTaskViewComponent', () => { + let component: DefaultSingleTaskViewComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DefaultSingleTaskViewComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultSingleTaskViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.ts new file mode 100644 index 0000000000..36ac35517e --- /dev/null +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.ts @@ -0,0 +1,74 @@ +import {Component} from '@angular/core'; +import { + AbstractSingleTaskViewComponent, + AllowedNetsService, + AllowedNetsServiceFactory, BaseAllowedNetsService, + ChangedFieldsService, FilterExtractionService, + FilterType, + FinishTaskService, + FrontActionService, + NAE_BASE_FILTER, NAE_NAVIGATION_ITEM_TASK_DATA, + NAE_TASK_OPERATIONS, + NAE_VIEW_ID_SEGMENT, navigationItemTaskAllowedNetsServiceFactory, navigationItemTaskFilterFactory, + RedirectService, + SearchService, + SimpleFilter, + SubjectTaskOperations, + TaskDataService, + TaskEventService, + TaskRequestStateService, + TaskViewService, + ViewIdService +} from "@netgrif/components-core"; +import {ActivatedRoute} from "@angular/router"; +import {AsyncPipe} from "@angular/common"; + +@Component({ + selector: 'nc-default-single-task-view', + templateUrl: './default-single-task-view.component.html', + styleUrls: ['./default-single-task-view.component.scss'], + providers: [ + TaskViewService, + SearchService, + RedirectService, + ChangedFieldsService, + { + provide: NAE_BASE_FILTER, + useFactory: navigationItemTaskFilterFactory, + deps: [FilterExtractionService, NAE_NAVIGATION_ITEM_TASK_DATA] + }, + {provide: NAE_VIEW_ID_SEGMENT, useValue: 'publicTaskView'}, + {provide: AllowedNetsServiceFactory, useClass: AllowedNetsServiceFactory}, + { + provide: AllowedNetsService, + useFactory: navigationItemTaskAllowedNetsServiceFactory, + deps: [AllowedNetsServiceFactory, BaseAllowedNetsService, NAE_NAVIGATION_ITEM_TASK_DATA] + }, + ViewIdService, + TaskDataService, + FrontActionService, + FinishTaskService, + TaskRequestStateService, + TaskEventService, + {provide: NAE_TASK_OPERATIONS, useClass: SubjectTaskOperations}, + AsyncPipe + ] +}) +export class DefaultSingleTaskViewComponent extends AbstractSingleTaskViewComponent { + + hidePanelHeader = true; + hideActionRow = false; + showPageHeader: boolean = true; + showPageFooter: boolean = false; + actionRowJustifyContent: "center" = "center"; + showFinishButton: boolean = true; + + constructor(taskViewService: TaskViewService, + activatedRoute: ActivatedRoute) { + super(taskViewService, activatedRoute); + } + + public getFinishTitle(): string { + return (this.finishTitle === '' || this.finishTitle) ? this.finishTitle : 'tasks.view.finish'; + } +} diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.html similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.html rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.html diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.scss rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.scss diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.spec.ts similarity index 98% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.spec.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.spec.ts index 0bbb46bf6a..756a88802b 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.spec.ts @@ -1,6 +1,6 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {DefaultTabViewComponent} from './default-tab-view.component'; -import {NavigationComponentModule} from '../../../navigation.module'; +import {NavigationComponentModule} from '../../../../navigation.module'; import { BooleanField, EnumerationField, @@ -19,7 +19,7 @@ import { TranslateLibModule, UserFilterConstants, ViewService -} from '@netgrif/components-core'; +} from 'netgrif-components-core'; import {RouterModule} from '@angular/router'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.ts similarity index 99% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.ts index cd204dd9e4..2a276e2d21 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.ts @@ -16,7 +16,7 @@ import { ViewIdService, FilterExtractionService, GroupNavigationConstants -} from '@netgrif/components-core'; +} from 'netgrif-components-core'; import {DefaultTabbedCaseViewComponent} from '../default-tabbed-case-view/default-tabbed-case-view.component'; import {DefaultTabbedTaskViewComponent} from '../default-tabbed-task-view/default-tabbed-task-view.component'; import {ActivatedRoute} from '@angular/router'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.html similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.html rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.html diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.scss rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.scss diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts similarity index 97% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts index 2e134e40bf..0af081d073 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts @@ -1,6 +1,6 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {DefaultTabbedCaseViewComponent} from './default-tabbed-case-view.component'; -import {NavigationComponentModule} from '../../../navigation.module'; +import {NavigationComponentModule} from '../../../../navigation.module'; import { BooleanField, FilterField, @@ -14,7 +14,7 @@ import { TestMockDependenciesModule, TextField, UserFilterConstants -} from '@netgrif/components-core'; +} from 'netgrif-components-core'; import {of} from 'rxjs'; import {DefaultTabbedTaskViewComponent} from '../default-tabbed-task-view/default-tabbed-task-view.component'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.ts similarity index 97% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.ts index ee536cf95e..44d276347b 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.ts @@ -28,16 +28,16 @@ import { navigationItemCaseViewDefaultHeadersFactory, NAE_NAVIGATION_ITEM_TASK_DATA, OverflowService, -} from '@netgrif/components-core'; -import {HeaderComponent} from '../../../../header/header.component'; +} from 'netgrif-components-core'; +import {HeaderComponent} from '../../../../../header/header.component'; import { InjectedTabbedCaseViewDataWithNavigationItemTaskData -} from '../model/injected-tabbed-case-view-data-with-navigation-item-task-data'; +} from '../../model/injected-tabbed-case-view-data-with-navigation-item-task-data'; import { filterCaseTabbedDataAllowedNetsServiceFactory, filterCaseTabbedDataFilterFactory, filterCaseTabbedDataSearchCategoriesFactory -} from '../model/factory-methods'; +} from '../../model/factory-methods'; @Component({ selector: 'nc-default-tabbed-case-view', 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.html 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.html new file mode 100644 index 0000000000..77332d0c50 --- /dev/null +++ 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.html @@ -0,0 +1,17 @@ +
+
+ +
+
+ + + + + + + + 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.scss 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.scss new file mode 100644 index 0000000000..e69de29bb2 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.spec.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.spec.ts new file mode 100644 index 0000000000..8664bf987c --- /dev/null +++ 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.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DefaultTabbedSingleTaskViewComponent } from './default-tabbed-single-task-view.component'; + +describe('DefaultTabbedSingleTaskViewComponent', () => { + let component: DefaultTabbedSingleTaskViewComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DefaultTabbedSingleTaskViewComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultTabbedSingleTaskViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 0000000000..a2944f4461 --- /dev/null +++ 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 @@ -0,0 +1,97 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {ActivatedRoute, Router} from "@angular/router"; +import { + AbstractTabbedSingleTaskViewComponent, + AllowedNetsService, + AllowedNetsServiceFactory, + ChangedFieldsService, + FinishTaskService, + NAE_BASE_FILTER, + NAE_TAB_DATA, + NAE_TASK_OPERATIONS, + NAE_VIEW_ID_SEGMENT, + FrontActionService, + RedirectService, + SearchService, + SubjectTaskOperations, + TaskDataService, + TaskEventService, + TaskRequestStateService, + TaskViewService, + ViewIdService, +} from 'netgrif-components-core'; +import {AsyncPipe} from "@angular/common"; +import { + InjectedTabbedTaskViewDataWithNavigationItemTaskData +} from "../../model/injected-tabbed-task-view-data-with-navigation-item-task-data"; + +function baseFilterFactory(injectedTabData: InjectedTabbedTaskViewDataWithNavigationItemTaskData) { + return { + filter: injectedTabData.baseFilter + }; +} + +const localAllowedNetsFactory = (factory: AllowedNetsServiceFactory) => { + return factory.createWithAllNets(); +}; + +@Component({ + selector: 'nc-default-tabbed-single-task-view', + templateUrl: './default-tabbed-single-task-view.component.html', + styleUrls: ['./default-tabbed-single-task-view.component.scss'], + providers: [ + TaskViewService, + SearchService, + RedirectService, + ChangedFieldsService, + { + provide: NAE_BASE_FILTER, + useFactory: baseFilterFactory, + deps: [NAE_TAB_DATA] + }, + {provide: NAE_VIEW_ID_SEGMENT, useValue: 'publicTaskView'}, + {provide: AllowedNetsServiceFactory, useClass: AllowedNetsServiceFactory}, + { + provide: AllowedNetsService, + useFactory: localAllowedNetsFactory, + deps: [AllowedNetsServiceFactory] + }, + ViewIdService, + TaskDataService, + FrontActionService, + FinishTaskService, + TaskRequestStateService, + TaskEventService, + {provide: NAE_TASK_OPERATIONS, useClass: SubjectTaskOperations}, + AsyncPipe + ] +}) +export class DefaultTabbedSingleTaskViewComponent extends AbstractTabbedSingleTaskViewComponent implements OnInit { + + hidePanelHeader = true; + hideActionRow = false; + showPageHeader: boolean = true; + showPageFooter: boolean = false; + actionRowJustifyContent: "center" = "center"; + showFinishButton: boolean = true; + showCloseButton: boolean = true; + + constructor(taskViewService: TaskViewService, + @Inject(NAE_TAB_DATA) injectedTabData: InjectedTabbedTaskViewDataWithNavigationItemTaskData, + activatedRoute: ActivatedRoute, + protected _router: Router) { + super(taskViewService, injectedTabData, activatedRoute); + } + + ngOnInit(): void { + this._router.routeReuseStrategy.shouldReuseRoute = () => false; + } + + closeTab() { + this._injectedTabData.tabViewRef.closeTabIndex(this._injectedTabData.tabViewRef.currentlySelectedTab()); + } + + public getFinishTitle(): string { + return (this.finishTitle === '' || this.finishTitle) ? this.finishTitle : 'tasks.view.finish'; + } +} diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.html similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.html rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.html diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.scss b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.scss rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.scss diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts similarity index 96% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts index 929b63ef2b..308facf8ea 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts @@ -1,6 +1,6 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {DefaultTabbedTaskViewComponent} from './default-tabbed-task-view.component'; -import {NavigationComponentModule} from '../../../navigation.module'; +import {NavigationComponentModule} from '../../../../navigation.module'; import { BooleanField, GroupNavigationConstants, @@ -13,7 +13,7 @@ import { TestMockDependenciesModule, TextField, ViewIdService -} from '@netgrif/components-core'; +} from 'netgrif-components-core'; import {of} from 'rxjs'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {RouterTestingModule} from '@angular/router/testing'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.ts similarity index 95% rename from projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.ts rename to projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.ts index a21271964a..c322ef7aa6 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.ts @@ -19,11 +19,11 @@ import { NAE_DEFAULT_HEADERS, NAE_NAVIGATION_ITEM_TASK_DATA, OverflowService, -} from '@netgrif/components-core'; -import {HeaderComponent} from '../../../../header/header.component'; +} from 'netgrif-components-core'; +import {HeaderComponent} from '../../../../../header/header.component'; import { InjectedTabbedTaskViewDataWithNavigationItemTaskData -} from "../model/injected-tabbed-task-view-data-with-navigation-item-task-data"; +} from "../../model/injected-tabbed-task-view-data-with-navigation-item-task-data"; export function baseFilterFactory(injectedTabData: InjectedTabbedTaskViewDataWithNavigationItemTaskData) { return { diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-group-navigation-component-resolver.service.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-group-navigation-component-resolver.service.ts index f62b6af08a..10a8392305 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-group-navigation-component-resolver.service.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-group-navigation-component-resolver.service.ts @@ -13,7 +13,7 @@ import { RoutingBuilderService, GroupNavigationConstants } from '@netgrif/components-core'; -import {DefaultTabViewComponent} from './default-components/default-tab-view/default-tab-view.component'; +import {DefaultTabViewComponent} from './default-components/tabbed/default-tab-view/default-tab-view.component'; import { DefaultNoFilterProvidedComponent } from "./default-components/default-no-filter-provided/default-no-filter-provided.component"; diff --git a/projects/netgrif-components/src/lib/navigation/navigation.module.ts b/projects/netgrif-components/src/lib/navigation/navigation.module.ts index aa2fd62d49..6c18a6f0c8 100644 --- a/projects/netgrif-components/src/lib/navigation/navigation.module.ts +++ b/projects/netgrif-components/src/lib/navigation/navigation.module.ts @@ -25,16 +25,16 @@ import { } from './group-navigation-component-resolver/default-group-navigation-component-resolver.service'; import { DefaultSimpleTaskViewComponent -} from './group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component'; +} from './group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component'; import { DefaultTabbedTaskViewComponent -} from './group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component'; +} from './group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; import { DefaultTabbedCaseViewComponent -} from './group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component'; +} from './group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component'; import { DefaultTabViewComponent -} from './group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component'; +} from './group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component'; import {SearchComponentModule} from '../search/search.module'; import {HeaderComponentModule} from '../header/header.module'; import {PanelComponentModule} from '../panel/panel.module'; @@ -43,8 +43,8 @@ import {CaseViewComponentModule} from '../view/case-view/case-view.module'; import { NavigationDoubleDrawerComponent } from './navigation-double-drawer/navigation-double-drawer.component'; import { MatDividerModule } from '@angular/material/divider'; import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component'; -import { DefaultTaskViewComponent } from './group-navigation-component-resolver/default-components/default-task-view/default-task-view.component'; -import { DefaultCaseRefListViewComponent } from './group-navigation-component-resolver/default-components/default-case-ref-list-view/default-case-ref-list-view.component'; +import { DefaultTaskViewComponent } from './group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component'; +import { DefaultCaseRefListViewComponent } from './group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component'; import { DefaultNoFilterProvidedComponent } from './group-navigation-component-resolver/default-components/default-no-filter-provided/default-no-filter-provided.component'; import { DefaultPublicResolverComponent } from './group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component'; import {TranslateModule} from "@ngx-translate/core"; @@ -54,6 +54,8 @@ import {MatCardModule} from "@angular/material/card"; import {MatIconModule} from "@angular/material/icon"; import { DefaultPublicTaskViewComponent } from './group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component'; import { DefaultPublicWorkflowViewComponent } from './group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component'; +import { DefaultTabbedSingleTaskViewComponent } from './group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component'; +import { DefaultSingleTaskViewComponent } from './group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component'; @NgModule({ @@ -75,7 +77,9 @@ import { DefaultPublicWorkflowViewComponent } from './group-navigation-component DefaultPublicResolverComponent, DefaultPublicSingleTaskViewComponent, DefaultPublicTaskViewComponent, - DefaultPublicWorkflowViewComponent + DefaultPublicWorkflowViewComponent, + DefaultTabbedSingleTaskViewComponent, + DefaultSingleTaskViewComponent ], imports: [ CommonModule, @@ -114,7 +118,8 @@ import { DefaultPublicWorkflowViewComponent } from './group-navigation-component DefaultPublicResolverComponent, DefaultPublicSingleTaskViewComponent, DefaultPublicTaskViewComponent, - DefaultPublicWorkflowViewComponent + DefaultPublicWorkflowViewComponent, + DefaultTabbedSingleTaskViewComponent ], providers: [ { provide: NAE_GROUP_NAVIGATION_COMPONENT_RESOLVER_COMPONENT, useValue: GroupNavigationComponentResolverComponent }, diff --git a/projects/netgrif-components/src/lib/navigation/public-api.ts b/projects/netgrif-components/src/lib/navigation/public-api.ts index cb253f90e5..34598337a2 100644 --- a/projects/netgrif-components/src/lib/navigation/public-api.ts +++ b/projects/netgrif-components/src/lib/navigation/public-api.ts @@ -10,12 +10,14 @@ export * from './navigation-drawer/navigation-drawer.component'; export * from './navigation-double-drawer/navigation-double-drawer.component'; export * from './navigation-rail/navigation-rail.component'; export * from './group-navigation-component-resolver/group-navigation-component-resolver.component'; -export * from './group-navigation-component-resolver/default-components/default-simple-task-view/default-simple-task-view.component'; -export * from './group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component'; -export * from './group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component'; -export * from './group-navigation-component-resolver/default-components/default-tabbed-task-view/default-tabbed-task-view.component'; +export * from './group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component'; +export * from './group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component'; +export * from './group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component'; +export * from './group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; +export * from './group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component'; +export * from './group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component'; export * from './breadcrumbs/breadcrumbs.component'; -export * from './group-navigation-component-resolver/default-components/default-task-view/default-task-view.component'; +export * from './group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component'; export * from './group-navigation-component-resolver/default-components/public/default-public-resolver/default-public-resolver.component'; export * from './group-navigation-component-resolver/default-components/public/default-public-task-view/default-public-task-view.component'; export * from './group-navigation-component-resolver/default-components/public/default-public-workflow-view/default-public-workflow-view.component'; From 52058e06555e45e18a0a4e07cacd2dc4fd101e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Mon, 10 Feb 2025 10:37:06 +0100 Subject: [PATCH 6/7] =?UTF-8?q?[NAE-2035]=20-=20Single-Task-View=20v=20int?= =?UTF-8?q?ernej=20=C4=8Dasti=20aplik=C3=A1cie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix tests --- ...bstract-single-task-view.component.spec.ts | 5 +- ...default-single-task-view.component.spec.ts | 63 +++++++++++++++++-- ...-tabbed-single-task-view.component.spec.ts | 63 +++++++++++++------ 3 files changed, 106 insertions(+), 25 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.spec.ts b/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.spec.ts index 7e06c390b8..68e1bbc522 100644 --- a/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.spec.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.spec.ts @@ -79,8 +79,7 @@ describe('AbstractSingleTaskViewComponent', () => { }) class TestAbstractSingleTaskViewComponent extends AbstractSingleTaskViewComponent { constructor(taskViewService: TaskViewService, - activatedRoute: ActivatedRoute, - @Inject(NAE_BASE_FILTER) baseFilter: BaseFilter){ - super(taskViewService, activatedRoute, baseFilter); + activatedRoute: ActivatedRoute){ + super(taskViewService, activatedRoute); } } diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts index 2f467e6d73..3d3e292ca7 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts @@ -1,16 +1,71 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DefaultSingleTaskViewComponent } from './default-single-task-view.component'; +import {HeaderComponentModule} from "../../../../../header/header.module"; +import {PanelComponentModule} from "../../../../../panel/panel.module"; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {RouterTestingModule} from "@angular/router/testing"; +import {Observable} from "rxjs"; +import { + DefaultTabbedSingleTaskViewComponent +} from "../../tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component"; +import { + AuthenticationMethodService, + ConfigurationService, FilterType, + MaterialModule, + NAE_TAB_DATA, SimpleFilter, + TestConfigurationService +} from "@netgrif/components-core"; +import {FilterField, NAE_NAVIGATION_ITEM_TASK_DATA, UserFilterConstants} from "netgrif-components-core"; describe('DefaultSingleTaskViewComponent', () => { let component: DefaultSingleTaskViewComponent; let fixture: ComponentFixture; beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ DefaultSingleTaskViewComponent ] - }) - .compileComponents(); + await TestBed.configureTestingModule({ + imports: [ + MaterialModule, + HeaderComponentModule, + PanelComponentModule, + BrowserAnimationsModule, + RouterTestingModule.withRoutes([]) + ], + providers: [ + { + provide: NAE_TAB_DATA, + useValue: {baseFilter: new SimpleFilter('id', FilterType.TASK, {}), tabSelected$: new Observable()} + }, + AuthenticationMethodService, + {provide: ConfigurationService, useClass: TestConfigurationService}, + { + provide: NAE_NAVIGATION_ITEM_TASK_DATA, + useValue: [ + {fields: []}, + { + fields: [ + new FilterField( + UserFilterConstants.FILTER_FIELD_ID, + '', + '', + { + filterType: FilterType.TASK, + predicateMetadata: [], + searchCategories: [] + }, + [], + {visible: true}, + '', + '' + ) + ] + } + ] + }, + ], + declarations: [DefaultSingleTaskViewComponent] + }) + .compileComponents(); }); beforeEach(() => { 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.spec.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.spec.ts index 8664bf987c..4660f87af2 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.spec.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.spec.ts @@ -1,25 +1,52 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { DefaultTabbedSingleTaskViewComponent } from './default-tabbed-single-task-view.component'; +import {DefaultTabbedSingleTaskViewComponent} from './default-tabbed-single-task-view.component'; +import {HeaderComponentModule} from "../../../../../header/header.module"; +import {PanelComponentModule} from "../../../../../panel/panel.module"; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {RouterTestingModule} from "@angular/router/testing"; +import {Observable} from "rxjs"; +import { + AuthenticationMethodService, + ConfigurationService, + FilterType, + MaterialModule, NAE_TAB_DATA, SimpleFilter, + TestConfigurationService +} from "@netgrif/components-core"; describe('DefaultTabbedSingleTaskViewComponent', () => { - let component: DefaultTabbedSingleTaskViewComponent; - let fixture: ComponentFixture; + let component: DefaultTabbedSingleTaskViewComponent; + let fixture: ComponentFixture; - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ DefaultTabbedSingleTaskViewComponent ] - }) - .compileComponents(); - }); + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ + MaterialModule, + HeaderComponentModule, + PanelComponentModule, + BrowserAnimationsModule, + RouterTestingModule.withRoutes([]) + ], + providers: [ + { + provide: NAE_TAB_DATA, + useValue: {baseFilter: new SimpleFilter('id', FilterType.TASK, {}), tabSelected$: new Observable()} + }, + AuthenticationMethodService, + {provide: ConfigurationService, useClass: TestConfigurationService} + ], + declarations: [DefaultTabbedSingleTaskViewComponent] + }) + .compileComponents(); + }); - beforeEach(() => { - fixture = TestBed.createComponent(DefaultTabbedSingleTaskViewComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + beforeEach(() => { + fixture = TestBed.createComponent(DefaultTabbedSingleTaskViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); - it('should create', () => { - expect(component).toBeTruthy(); - }); + it('should create', () => { + expect(component).toBeTruthy(); + }); }); From 4df3ad5c27d55840dea9b445aa518798cf8a2fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Tue, 11 Feb 2025 11:53:09 +0100 Subject: [PATCH 7/7] =?UTF-8?q?[NAE-2035]=20-=20Single-Task-View=20v=20int?= =?UTF-8?q?ernej=20=C4=8Dasti=20aplik=C3=A1cie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix imports --- .../enumeration-caseref-field.component.spec.ts | 2 +- .../multichoice-caseref-field.component.spec.ts | 2 +- .../task-ref-list-field/task-ref-list-field.component.spec.ts | 2 +- .../default-case-ref-list-view.component.spec.ts | 2 +- .../default-case-ref-list-view.component.ts | 2 +- .../refs/default-task-view/default-task-view.component.spec.ts | 2 +- .../refs/default-task-view/default-task-view.component.ts | 2 +- .../default-simple-task-view.component.spec.ts | 2 +- .../default-simple-task-view.component.ts | 2 +- .../default-single-task-view.component.spec.ts | 2 +- .../tabbed/default-tab-view/default-tab-view.component.spec.ts | 2 +- .../tabbed/default-tab-view/default-tab-view.component.ts | 2 +- .../default-tabbed-case-view.component.spec.ts | 2 +- .../default-tabbed-case-view.component.ts | 2 +- .../default-tabbed-single-task-view.component.ts | 2 +- .../default-tabbed-task-view.component.spec.ts | 2 +- .../default-tabbed-task-view.component.ts | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts b/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts index 06fa1276eb..cfd56a1ebd 100644 --- a/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts +++ b/projects/netgrif-components/src/lib/data-fields/enumeration-field/enumeration-caseref-field/enumeration-caseref-field.component.spec.ts @@ -7,7 +7,7 @@ import { NAE_VIEW_ID_SEGMENT, OverflowService, TestMockDependenciesModule, UserFilterConstants -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {RouterTestingModule} from '@angular/router/testing'; import {of} from 'rxjs'; diff --git a/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts b/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts index 9ba6733e12..8d642303f3 100644 --- a/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts +++ b/projects/netgrif-components/src/lib/data-fields/multichoice-field/multichoice-caseref-field/multichoice-caseref-field.component.spec.ts @@ -7,7 +7,7 @@ import { NAE_VIEW_ID_SEGMENT, OverflowService, TestMockDependenciesModule, UserFilterConstants -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {RouterTestingModule} from '@angular/router/testing'; import {of} from 'rxjs'; diff --git a/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.spec.ts b/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.spec.ts index 8be536c0a9..322c4bc1d9 100644 --- a/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.spec.ts +++ b/projects/netgrif-components/src/lib/data-fields/task-ref-field/task-ref-list-field/task-ref-list-field.component.spec.ts @@ -2,7 +2,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {TaskRefListFieldComponent} from './task-ref-list-field.component'; import {Component} from "@angular/core"; -import {TaskRefField} from "netgrif-components-core"; +import {TaskRefField} from "@netgrif/components-core"; describe('TaskRefListFieldComponent', () => { let component: TaskRefListFieldComponent; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts index 57748728ec..2d98ba53b9 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.spec.ts @@ -10,7 +10,7 @@ import { TestMockDependenciesModule, UserFilterConstants, NAE_BASE_FILTER, SimpleFilter -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {RouterTestingModule} from '@angular/router/testing'; import {of} from 'rxjs'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts index 14f88b5a72..7beb85b243 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts @@ -20,7 +20,7 @@ import { SimpleFilter, TaskSetDataRequestFields, ViewIdService, DATA_FIELD_PORTAL_DATA, DataFieldPortalData, MultichoiceField, EnumerationField -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {HeaderComponent} from '../../../../../header/header.component' import {DefaultTabbedTaskViewComponent} from '../../tabbed/default-tabbed-task-view/default-tabbed-task-view.component'; import { diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.spec.ts index bf3663455e..74bbe42aa8 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.spec.ts @@ -2,7 +2,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {DefaultTaskViewComponent} from './default-task-view.component'; import {NavigationComponentModule} from "../../../../navigation.module"; -import {NAE_BASE_FILTER, NAE_VIEW_ID_SEGMENT, SimpleFilter, TestMockDependenciesModule} from "netgrif-components-core"; +import {NAE_BASE_FILTER, NAE_VIEW_ID_SEGMENT, SimpleFilter, TestMockDependenciesModule} from "@netgrif/components-core"; import {NoopAnimationsModule} from "@angular/platform-browser/animations"; import {RouterTestingModule} from "@angular/router/testing"; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts index 7602eb4983..efdd29ca43 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts @@ -10,7 +10,7 @@ import { SearchService, TaskEventNotification, TaskViewService, ViewIdService -} from "netgrif-components-core"; +} from "@netgrif/components-core"; import {HeaderComponent} from "../../../../../header/header.component"; const localAllowedNetsFactory = (factory: AllowedNetsServiceFactory) => { diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.spec.ts index 755f5f9d55..876cc634a9 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.spec.ts @@ -7,7 +7,7 @@ import { OverflowService, TestMockDependenciesModule, UserFilterConstants -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {RouterModule} from '@angular/router'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.ts index 1d8de6264f..a5bd7a8ad5 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-simple-task-view/default-simple-task-view.component.ts @@ -18,7 +18,7 @@ import { CategoryResolverService, NAE_DEFAULT_CASE_SEARCH_CATEGORIES, NAE_DEFAULT_TASK_SEARCH_CATEGORIES, BaseAllowedNetsService, FilterExtractionService, ChangedFieldsService -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {HeaderComponent} from '../../../../../header/header.component'; import {ActivatedRoute} from '@angular/router'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts index 3d3e292ca7..11438a8f8f 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/simple-views/default-single-task-view/default-single-task-view.component.spec.ts @@ -16,7 +16,7 @@ import { NAE_TAB_DATA, SimpleFilter, TestConfigurationService } from "@netgrif/components-core"; -import {FilterField, NAE_NAVIGATION_ITEM_TASK_DATA, UserFilterConstants} from "netgrif-components-core"; +import {FilterField, NAE_NAVIGATION_ITEM_TASK_DATA, UserFilterConstants} from "@netgrif/components-core"; describe('DefaultSingleTaskViewComponent', () => { let component: DefaultSingleTaskViewComponent; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.spec.ts index 756a88802b..b38410db93 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.spec.ts @@ -19,7 +19,7 @@ import { TranslateLibModule, UserFilterConstants, ViewService -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {RouterModule} from '@angular/router'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.ts index 2a276e2d21..cd204dd9e4 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tab-view/default-tab-view.component.ts @@ -16,7 +16,7 @@ import { ViewIdService, FilterExtractionService, GroupNavigationConstants -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {DefaultTabbedCaseViewComponent} from '../default-tabbed-case-view/default-tabbed-case-view.component'; import {DefaultTabbedTaskViewComponent} from '../default-tabbed-task-view/default-tabbed-task-view.component'; import {ActivatedRoute} from '@angular/router'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts index 0af081d073..d86b067e96 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.spec.ts @@ -14,7 +14,7 @@ import { TestMockDependenciesModule, TextField, UserFilterConstants -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {of} from 'rxjs'; import {DefaultTabbedTaskViewComponent} from '../default-tabbed-task-view/default-tabbed-task-view.component'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.ts index 44d276347b..19a9b093dc 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-case-view/default-tabbed-case-view.component.ts @@ -28,7 +28,7 @@ import { navigationItemCaseViewDefaultHeadersFactory, NAE_NAVIGATION_ITEM_TASK_DATA, OverflowService, -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {HeaderComponent} from '../../../../../header/header.component'; import { InjectedTabbedCaseViewDataWithNavigationItemTaskData 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 a2944f4461..3577aeaefe 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,7 +19,7 @@ import { TaskRequestStateService, TaskViewService, ViewIdService, -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {AsyncPipe} from "@angular/common"; import { InjectedTabbedTaskViewDataWithNavigationItemTaskData diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts index 308facf8ea..7de662e9e8 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.spec.ts @@ -13,7 +13,7 @@ import { TestMockDependenciesModule, TextField, ViewIdService -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {of} from 'rxjs'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {RouterTestingModule} from '@angular/router/testing'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.ts index c322ef7aa6..7f848cca8f 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-task-view/default-tabbed-task-view.component.ts @@ -19,7 +19,7 @@ import { NAE_DEFAULT_HEADERS, NAE_NAVIGATION_ITEM_TASK_DATA, OverflowService, -} from 'netgrif-components-core'; +} from '@netgrif/components-core'; import {HeaderComponent} from '../../../../../header/header.component'; import { InjectedTabbedTaskViewDataWithNavigationItemTaskData