Skip to content

Commit ac025bc

Browse files
committed
[NAE-2125] Remove URI service usage from admin and menu items
- Updated references to `_uriService` to `_pathService` in multiple components.
1 parent 763b510 commit ac025bc

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

projects/netgrif-components-core/src/lib/navigation/breadcrumbs/abstract-breadcrumbs.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export abstract class AbstractBreadcrumbsComponent implements OnDestroy, AfterVi
3838
private redirectUrls: Map<string, Array<string>>;
3939
private nicePathSubscription: Subscription;
4040

41-
protected constructor(protected _uriService: PathService,
41+
protected constructor(protected _pathService: PathService,
4242
protected _caseResourceService: CaseResourceService,
4343
protected _activatedRoute: ActivatedRoute,
4444
protected _router: Router,
@@ -66,7 +66,7 @@ export abstract class AbstractBreadcrumbsComponent implements OnDestroy, AfterVi
6666
this._log.error("Missing required data for resolving breadcrumbs.")
6767
return;
6868
}
69-
const splitPath = this._uriService.splitPath(this._uriService.activePath);
69+
const splitPath = this._pathService.splitPath(this._pathService.activePath);
7070
const fullPath = this.createFullPath(splitPath);
7171
const fullPathQueries = fullPath.map(p => '(processIdentifier:preference_item AND dataSet.nodePath.textValue.keyword:\"' + p + '\")')
7272
fullPathQueries.push('(taskMongoIds:\"' + filterId + '\")')
@@ -97,7 +97,7 @@ export abstract class AbstractBreadcrumbsComponent implements OnDestroy, AfterVi
9797
this.nicePathSubscription = this.nicePath.subscribe(np => {
9898
if (!!np) {
9999
const path = np;
100-
if (path?.length > this.partsAfterDots + 1 && this._uriService.activePath.length > this.lengthOfPath && !this._showPaths) {
100+
if (path?.length > this.partsAfterDots + 1 && this._pathService.activePath.length > this.lengthOfPath && !this._showPaths) {
101101
const newPath = [path[0], AbstractBreadcrumbsComponent.DOTS];
102102
for (let i = path.length - this.partsAfterDots; i < path.length; i++) {
103103
newPath.push(path[i]);
@@ -114,12 +114,12 @@ export abstract class AbstractBreadcrumbsComponent implements OnDestroy, AfterVi
114114
if (!this.redirectOnClick) {
115115
return;
116116
}
117-
this._router.navigate(this.redirectUrls.get(this._uriService.activePath)).then(r => {})
117+
this._router.navigate(this.redirectUrls.get(this._pathService.activePath)).then(r => {})
118118
}
119119

120120
public reset(): void {
121121
this.filterName = undefined;
122-
this._uriService.reset();
122+
this._pathService.reset();
123123
this.nicePath.next([""])
124124
}
125125

@@ -130,21 +130,21 @@ export abstract class AbstractBreadcrumbsComponent implements OnDestroy, AfterVi
130130
return;
131131
}
132132
let fullPath: string = '';
133-
const tmp = this._uriService.splitPath(this._uriService.activePath);
133+
const tmp = this._pathService.splitPath(this._pathService.activePath);
134134
if (tmp === undefined) return;
135135
const control = this.resultCounter(count, tmp);
136136
for (let i = 0; i <= control; i++) {
137137
fullPath += tmp[i];
138138
if (i !== control) fullPath += AbstractBreadcrumbsComponent.DELIMETER;
139139
}
140-
this._uriService.activePath = fullPath;
140+
this._pathService.activePath = fullPath;
141141
this.filterName = undefined;
142142
this.nicePath.next(this.nicePath.value.slice(0, control + 1))
143143
this.redirect();
144144
}
145145

146146
private resultCounter(count: number, tmp: string[]): number {
147-
if (tmp?.length > this.partsAfterDots + 1 && this._uriService.activePath?.length > this.lengthOfPath && !this._showPaths) {
147+
if (tmp?.length > this.partsAfterDots + 1 && this._pathService.activePath?.length > this.lengthOfPath && !this._showPaths) {
148148
return tmp.length - this.partsAfterDots + (count - 2);
149149
}
150150
return count;

projects/netgrif-components-core/src/lib/navigation/navigation-double-drawer/abstract-navigation-double-drawer.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ class TestDrawerComponent extends AbstractNavigationDoubleDrawerComponent {
143143
_accessService: AccessService,
144144
_log: LoggerService,
145145
_config: ConfigurationService,
146-
_uriService: PathService,
146+
_pathService: PathService,
147147
_caseResourceService: CaseResourceService,
148148
_impersonationUserSelect: ImpersonationUserSelectService,
149149
_impersonation: ImpersonationService,
150150
_dynamicRouteProviderService: DynamicNavigationRouteProviderService) {
151151
super(_router, _activatedRoute, _breakpoint, _languageService, _translateService, _userService, _accessService,
152-
_log, _config, _uriService, _caseResourceService, _impersonationUserSelect, _impersonation, _dynamicRouteProviderService);
152+
_log, _config, _pathService, _caseResourceService, _impersonationUserSelect, _impersonation, _dynamicRouteProviderService);
153153
}
154154
}
155155

projects/netgrif-components-core/src/lib/side-menu/content-components/import-net/abstract-import-net.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ class MyPetriNetResource {
109109
class TestImportComponent extends AbstractImportNetComponent {
110110
constructor(@Inject(NAE_SIDE_MENU_CONTROL) protected _sideMenuControl: SideMenuControl,
111111
protected _petriNetResource: PetriNetResourceService,
112-
protected _uriService: PathService,
112+
protected _pathService: PathService,
113113
protected _log: LoggerService,
114114
protected _snackbar: SnackBarService,
115115
protected _translate: TranslateService) {
116-
super(_sideMenuControl, _petriNetResource, _uriService, _log, _snackbar, _translate);
116+
super(_sideMenuControl, _petriNetResource, _pathService, _log, _snackbar, _translate);
117117
}
118118
}

projects/netgrif-components-core/src/lib/side-menu/content-components/import-net/abstract-import-net.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export abstract class AbstractImportNetComponent implements AfterViewInit {
4343

4444
constructor(protected _sideMenuControl: SideMenuControl,
4545
protected _petriNetResource: PetriNetResourceService,
46-
protected _uriService: PathService,
46+
protected _pathService: PathService,
4747
protected _log: LoggerService,
4848
protected _snackbar: SnackBarService,
4949
protected _translate: TranslateService) {

projects/netgrif-components-core/src/lib/side-menu/side-menu-container/abstract-side-menu-container.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ class TestSideMenuComponent extends AbstractSideMenuContainerComponent {
8888
class TestImportComponent extends AbstractImportNetComponent {
8989
constructor(@Inject(NAE_SIDE_MENU_CONTROL) protected _sideMenuControl: SideMenuControl,
9090
protected _petriNetResource: PetriNetResourceService,
91-
protected _uriService: PathService,
91+
protected _pathService: PathService,
9292
protected _log: LoggerService,
9393
protected _snackbar: SnackBarService,
9494
protected _translate: TranslateService) {
95-
super(_sideMenuControl, _petriNetResource, _uriService, _log, _snackbar, _translate);
95+
super(_sideMenuControl, _petriNetResource, _pathService, _log, _snackbar, _translate);
9696
}
9797
}

0 commit comments

Comments
 (0)