diff --git a/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.scss b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.scss
similarity index 100%
rename from src/portal/src/app/project/helm-chart/label-marker/label-marker.component.scss
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.scss
diff --git a/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.spec.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.spec.ts
similarity index 93%
rename from src/portal/src/app/project/helm-chart/label-marker/label-marker.component.spec.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.spec.ts
index b35566c952..136c69c5b3 100644
--- a/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.spec.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.spec.ts
@@ -5,8 +5,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ClarityModule } from '@clr/angular';
import { FormsModule } from '@angular/forms';
import { of } from 'rxjs';
-import { LabelService } from "../../../../lib/services";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
+import { LabelService } from "../../../../../shared/services";
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
describe('LabelMarkerComponent', () => {
const mockErrorHandler = null;
diff --git a/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.ts
similarity index 95%
rename from src/portal/src/app/project/helm-chart/label-marker/label-marker.component.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.ts
index eaca58a5a4..a765404bf7 100644
--- a/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/label-marker/label-marker.component.ts
@@ -2,9 +2,9 @@ import { Component, Input, Output, OnInit, EventEmitter, ChangeDetectorRef, View
import { fromEvent, Subject } from 'rxjs';
import { debounceTime, finalize } from 'rxjs/operators';
import { HelmChartVersion } from '../helm-chart.interface.service';
-import { ResourceType } from '../../../shared/shared.const';
-import { Label, LabelService } from "../../../../lib/services";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
+import { Label, LabelService } from "../../../../../shared/services";
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
+import { ResourceType } from "../../../../../shared/entities/shared.const";
@Component({
selector: 'hbr-resource-label-marker',
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.html b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.html
similarity index 100%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.html
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.html
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss
similarity index 98%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss
index 662314f9d6..4728a0adee 100644
--- a/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss
@@ -1,4 +1,4 @@
-@import "../../../../../lib/mixin";
+@import "../../../../../../shared/mixin";
.title-container {
display: flex;
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.spec.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.spec.ts
similarity index 94%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.spec.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.spec.ts
index acde0e9819..dffde4f0c2 100644
--- a/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.spec.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.spec.ts
@@ -7,9 +7,9 @@ import { FormsModule } from '@angular/forms';
import { HelmChartService } from "../../helm-chart.service";
import { LabelFilterComponent } from "../../label-filter/label-filter.component";
import { of } from 'rxjs';
-import { LabelService, SystemInfoService, UserPermissionService } from "../../../../../lib/services";
-import { ErrorHandler } from "../../../../../lib/utils/error-handler";
-import { OperationService } from "../../../../../lib/components/operation/operation.service";
+import { LabelService, SystemInfoService, UserPermissionService } from "../../../../../../shared/services";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
+import { OperationService } from "../../../../../../shared/components/operation/operation.service";
import { delay } from "rxjs/operators";
describe('ChartVersionComponent', () => {
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts
similarity index 89%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts
index 34bbb75670..331020ea27 100644
--- a/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts
@@ -3,8 +3,6 @@ import {
Input,
OnInit,
ViewChild,
- ChangeDetectionStrategy,
- ChangeDetectorRef,
Output,
EventEmitter
} from "@angular/core";
@@ -13,16 +11,6 @@ import { finalize, map, catchError } from "rxjs/operators";
import { TranslateService } from "@ngx-translate/core";
import { HelmChartVersion, HelmChartMaintainer } from "../../helm-chart.interface.service";
import { HelmChartService } from "../../helm-chart.service";
-import { ConfirmationAcknowledgement } from "../../../../shared/confirmation-dialog/confirmation-state-message";
-import { ConfirmationDialogComponent } from "../../../../shared/confirmation-dialog/confirmation-dialog.component";
-import { ConfirmationMessage } from "../../../../shared/confirmation-dialog/confirmation-message";
-import {
- ConfirmationButtons,
- ConfirmationTargets,
- ConfirmationState,
- DefaultHelmIcon,
- ResourceType,
-} from "../../../../shared/shared.const";
import {
Label,
LabelService,
@@ -30,12 +18,21 @@ import {
SystemInfo,
SystemInfoService,
UserPermissionService, USERSTATICPERMISSION
-} from "../../../../../lib/services";
-import { DEFAULT_PAGE_SIZE, downloadFile } from "../../../../../lib/utils/utils";
-import { ErrorHandler } from "../../../../../lib/utils/error-handler";
-import { OperationService } from "../../../../../lib/components/operation/operation.service";
-import { operateChanges, OperateInfo, OperationState } from "../../../../../lib/components/operation/operate";
-import { errorHandler as errorHandlerFn } from "../../../../../lib/utils/shared/shared.utils";
+} from "../../../../../../shared/services";
+import { DEFAULT_PAGE_SIZE, downloadFile } from "../../../../../../shared/units/utils";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
+import { OperationService } from "../../../../../../shared/components/operation/operation.service";
+import { operateChanges, OperateInfo, OperationState } from "../../../../../../shared/components/operation/operate";
+import {
+ ConfirmationButtons, ConfirmationState,
+ ConfirmationTargets,
+ DefaultHelmIcon,
+ ResourceType
+} from "../../../../../../shared/entities/shared.const";
+import { errorHandler } from "../../../../../../shared/units/shared.utils";
+import { ConfirmationDialogComponent } from "../../../../../../shared/components/confirmation-dialog";
+import { ConfirmationMessage } from "../../../../../global-confirmation-dialog/confirmation-message";
+import { ConfirmationAcknowledgement } from "../../../../../global-confirmation-dialog/confirmation-state-message";
@Component({
selector: "hbr-helm-chart-version",
@@ -82,7 +79,7 @@ export class ChartVersionComponent implements OnInit {
hasDownloadHelmChartVersionPermission: boolean;
hasDeleteHelmChartVersionPermission: boolean;
constructor(
- private errorHandler: ErrorHandler,
+ private errorHandlerEntity: ErrorHandler,
private systemInfoService: SystemInfoService,
private helmChartService: HelmChartService,
private resrouceLabelService: LabelService,
@@ -99,7 +96,7 @@ export class ChartVersionComponent implements OnInit {
// Get system info for tag views
this.systemInfoService.getSystemInfo()
.subscribe(systemInfo => (this.systemInfo = systemInfo)
- , error => this.errorHandler.error(error));
+ , error => this.errorHandlerEntity.error(error));
this.refresh();
this.getLabels();
this.lastFilteredVersionName = "";
@@ -133,7 +130,7 @@ export class ChartVersionComponent implements OnInit {
this.totalCount = versions.length;
},
err => {
- this.errorHandler.error(err);
+ this.errorHandlerEntity.error(err);
}
);
}
@@ -168,7 +165,7 @@ export class ChartVersionComponent implements OnInit {
.pipe(map(
() => operateChanges(operateMsg, OperationState.success)),
catchError( error => {
- const message = errorHandlerFn(error);
+ const message = errorHandler(error);
this.translateService.get(message).subscribe(res =>
operateChanges(operateMsg, OperationState.failure, res)
);
@@ -192,7 +189,7 @@ export class ChartVersionComponent implements OnInit {
this.backEvt.emit();
}
}, error => {
- this.errorHandler.error(error);
+ this.errorHandlerEntity.error(error);
});
}
@@ -221,7 +218,7 @@ export class ChartVersionComponent implements OnInit {
downloadFile(res);
},
error => {
- this.errorHandler.error(error);
+ this.errorHandlerEntity.error(error);
}
);
}
@@ -341,6 +338,6 @@ export class ChartVersionComponent implements OnInit {
this.hasAddRemoveHelmChartVersionPermission = permissions[0] as boolean;
this.hasDownloadHelmChartVersionPermission = permissions[1] as boolean;
this.hasDeleteHelmChartVersionPermission = permissions[2] as boolean;
- }, error => this.errorHandler.error(error));
+ }, error => this.errorHandlerEntity.error(error));
}
}
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.html b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.html
similarity index 100%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.html
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.html
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.scss b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.scss
similarity index 100%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.scss
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.scss
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.spec.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.spec.ts
similarity index 87%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.spec.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.spec.ts
index 0db7ac9e21..658d6c8117 100644
--- a/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.spec.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.spec.ts
@@ -4,8 +4,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { ActivatedRoute } from '@angular/router';
import { Router } from '@angular/router';
-import { of } from 'rxjs';
-import { SessionService } from './../../../shared/session.service';
+import { SessionService } from '../../../../../shared/services/session.service';
import { ListChartVersionsComponent } from './list-chart-versions.component';
describe('ListChartVersionsComponent', () => {
@@ -32,8 +31,13 @@ describe('ListChartVersionsComponent', () => {
{
provide: ActivatedRoute, useValue: {
snapshot: {
+ parent: {
+ params: {
+ id: 1,
+ },
+ data: null
+ },
params: {
- id: 1,
chart: 'chart'
}
}
diff --git a/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.ts
similarity index 77%
rename from src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.ts
index d0771eb7fa..5f619411d1 100644
--- a/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/list-chart-versions/list-chart-versions.component.ts
@@ -2,9 +2,9 @@ import { Router } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { Component, OnInit } from '@angular/core';
-import { Project } from '../../project';
-import { SessionUser } from '../../../shared/session-user';
-import { SessionService } from '../../../shared/session.service';
+import { Project } from '../../../project';
+import { SessionUser } from '../../../../../shared/entities/session-user';
+import { SessionService } from '../../../../../shared/services/session.service';
@Component({
selector: 'list-chart-version',
@@ -29,12 +29,12 @@ export class ListChartVersionsComponent implements OnInit {
private session: SessionService) {}
ngOnInit() {
- // Get projectId from route params snapshot.
- this.projectId = +this.route.snapshot.params['id'];
+ // Get projectId from router-guard params snapshot.
+ this.projectId = +this.route.snapshot.parent.params['id'];
this.chartName = this.route.snapshot.params['chart'];
// Get current user from registered resolver.
this.currentUser = this.session.getCurrentUser();
- let resolverData = this.route.snapshot.data;
+ let resolverData = this.route.snapshot.parent.data;
if (resolverData) {
let project =
(resolverData["projectResolver"]);
this.roleName = project.role_name;
diff --git a/src/portal/src/app/base/project/helm-chart/helm-chart-list/helm-chart-list.module.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-list/helm-chart-list.module.ts
new file mode 100644
index 0000000000..6b6a614c2d
--- /dev/null
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-list/helm-chart-list.module.ts
@@ -0,0 +1,37 @@
+// Copyright Project Harbor Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+import { NgModule } from '@angular/core';
+import { ListChartsComponent } from './list-charts.component';
+import { HelmChartComponent } from './list-charts-detail/helm-chart.component';
+import { SharedModule } from '../../../../shared/shared.module';
+import { RouterModule, Routes } from "@angular/router";
+
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ListChartsComponent
+ }
+];
+@NgModule({
+ imports: [
+ SharedModule,
+ RouterModule.forChild(routes)
+ ],
+ declarations: [
+ ListChartsComponent,
+ HelmChartComponent,
+ ],
+})
+export class HelmChartListModule { }
diff --git a/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.html b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.html
similarity index 100%
rename from src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.html
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.html
diff --git a/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.scss b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.scss
similarity index 98%
rename from src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.scss
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.scss
index f989289bec..bfb1c13246 100644
--- a/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.scss
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.scss
@@ -1,4 +1,4 @@
-@import "../../../../lib/mixin";
+@import "../../../../../shared/mixin";
$size24:24px;
$size60:60px;
diff --git a/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.spec.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.spec.ts
similarity index 92%
rename from src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.spec.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.spec.ts
index f0b1fca010..9151e2d3c8 100644
--- a/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.spec.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.spec.ts
@@ -5,10 +5,10 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ClarityModule } from '@clr/angular';
import { FormsModule } from '@angular/forms';
import { of } from 'rxjs';
-import { HelmChartService } from "../helm-chart.service";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
-import { SystemInfoService, UserPermissionService } from "../../../../lib/services";
-import { OperationService } from "../../../../lib/components/operation/operation.service";
+import { HelmChartService } from "../../helm-chart-detail/helm-chart.service";
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
+import { SystemInfoService, UserPermissionService } from "../../../../../shared/services";
+import { OperationService } from "../../../../../shared/components/operation/operation.service";
describe('HelmChartComponent', () => {
let component: HelmChartComponent;
diff --git a/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.ts
similarity index 85%
rename from src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.ts
index d729808bef..afbfd169ac 100644
--- a/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts-detail/helm-chart.component.ts
@@ -10,30 +10,30 @@ import { NgForm } from '@angular/forms';
import { TranslateService } from "@ngx-translate/core";
import { forkJoin, throwError as observableThrowError, Observable } from "rxjs";
import { finalize, map, catchError } from "rxjs/operators";
-import { HelmChartItem } from "../helm-chart.interface.service";
-import { HelmChartService } from "../helm-chart.service";
-import { DefaultHelmIcon, Roles } from "../../../shared/shared.const";
-
-import { ConfirmationAcknowledgement } from "../../../shared/confirmation-dialog/confirmation-state-message";
-import { ConfirmationDialogComponent } from "../../../shared/confirmation-dialog/confirmation-dialog.component";
-import { ConfirmationMessage } from "../../../shared/confirmation-dialog/confirmation-message";
-import {
- ConfirmationButtons,
- ConfirmationTargets,
- ConfirmationState,
-} from "../../../shared/shared.const";
+import { HelmChartItem } from "../../helm-chart-detail/helm-chart.interface.service";
+import { HelmChartService } from "../../helm-chart-detail/helm-chart.service";
import {
State,
SystemInfo,
SystemInfoService,
UserPermissionService,
USERSTATICPERMISSION
-} from "../../../../lib/services";
-import { DEFAULT_PAGE_SIZE, downloadFile } from "../../../../lib/utils/utils";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
-import { OperationService } from "../../../../lib/components/operation/operation.service";
-import { operateChanges, OperateInfo, OperationState } from "../../../../lib/components/operation/operate";
-import { errorHandler as errorHandlerFn } from "../../../../lib/utils/shared/shared.utils";
+} from "../../../../../shared/services";
+import { DEFAULT_PAGE_SIZE, downloadFile } from "../../../../../shared/units/utils";
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
+import { OperationService } from "../../../../../shared/components/operation/operation.service";
+import { operateChanges, OperateInfo, OperationState } from "../../../../../shared/components/operation/operate";
+import {
+ ConfirmationButtons, ConfirmationState,
+ ConfirmationTargets,
+ DefaultHelmIcon,
+ Roles
+} from "../../../../../shared/entities/shared.const";
+import { errorHandler } from "../../../../../shared/units/shared.utils";
+import { ConfirmationDialogComponent } from "../../../../../shared/components/confirmation-dialog";
+import { ConfirmationMessage } from "../../../../global-confirmation-dialog/confirmation-message";
+import { ConfirmationAcknowledgement } from "../../../../global-confirmation-dialog/confirmation-state-message";
+
@Component({
selector: "hbr-helm-chart",
@@ -81,7 +81,7 @@ export class HelmChartComponent implements OnInit {
hasDownloadHelmChartsPermission: boolean;
hasDeleteHelmChartsPermission: boolean;
constructor(
- private errorHandler: ErrorHandler,
+ private errorHandlerEntity: ErrorHandler,
private translateService: TranslateService,
private systemInfoService: SystemInfoService,
private helmChartService: HelmChartService,
@@ -97,7 +97,7 @@ export class HelmChartComponent implements OnInit {
// Get system info for tag views
this.systemInfoService.getSystemInfo()
.subscribe(systemInfo => (this.systemInfo = systemInfo)
- , error => this.errorHandler.error(error));
+ , error => this.errorHandlerEntity.error(error));
this.lastFilteredChartName = "";
this.refresh();
this.getHelmPermissionRule(this.projectId);
@@ -113,7 +113,7 @@ export class HelmChartComponent implements OnInit {
this.hasUploadHelmChartsPermission = permissions[0] as boolean;
this.hasDownloadHelmChartsPermission = permissions[1] as boolean;
this.hasDeleteHelmChartsPermission = permissions[2] as boolean;
- }, error => this.errorHandler.error(error));
+ }, error => this.errorHandlerEntity.error(error));
}
updateFilterValue(value: string) {
this.lastFilteredChartName = value;
@@ -135,7 +135,7 @@ export class HelmChartComponent implements OnInit {
this.totalCount = charts.length;
},
err => {
- this.errorHandler.error(err);
+ this.errorHandlerEntity.error(err);
}
);
}
@@ -176,9 +176,9 @@ export class HelmChartComponent implements OnInit {
.subscribe(() => {
this.translateService
.get("HELM_CHART.FILE_UPLOADED")
- .subscribe(res => this.errorHandler.info(res));
+ .subscribe(res => this.errorHandlerEntity.info(res));
},
- err => this.errorHandler.error(err)
+ err => this.errorHandlerEntity.error(err)
);
}
@@ -206,7 +206,7 @@ export class HelmChartComponent implements OnInit {
.pipe(map(
() => operateChanges(operateMsg, OperationState.success)),
catchError( error => {
- const message = errorHandlerFn(error);
+ const message = errorHandler(error);
this.translateService.get(message).subscribe(res =>
operateChanges(operateMsg, OperationState.failure, res)
);
@@ -226,7 +226,7 @@ export class HelmChartComponent implements OnInit {
}))
.subscribe(() => { }
, error => {
- this.errorHandler.error(error);
+ this.errorHandlerEntity.error(error);
});
}
@@ -254,7 +254,7 @@ export class HelmChartComponent implements OnInit {
downloadFile(res);
},
error => {
- this.errorHandler.error(error);
+ this.errorHandlerEntity.error(error);
}
);
}
diff --git a/src/portal/src/app/project/helm-chart/list-charts.component.html b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.html
similarity index 100%
rename from src/portal/src/app/project/helm-chart/list-charts.component.html
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.html
diff --git a/src/portal/src/app/project/helm-chart/list-charts.component.scss b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.scss
similarity index 100%
rename from src/portal/src/app/project/helm-chart/list-charts.component.scss
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.scss
diff --git a/src/portal/src/app/project/helm-chart/list-charts.component.spec.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.spec.ts
similarity index 75%
rename from src/portal/src/app/project/helm-chart/list-charts.component.spec.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.spec.ts
index bfd6f22e5d..41b230376e 100644
--- a/src/portal/src/app/project/helm-chart/list-charts.component.spec.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.spec.ts
@@ -1,10 +1,9 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { ClarityModule } from '@clr/angular';
-import { TranslateModule, TranslateService } from '@ngx-translate/core';
-import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectorRef } from '@angular/core';
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
-import { SessionService } from '../../shared/session.service';
+import { SessionService } from '../../../../shared/services/session.service';
import { ListChartsComponent } from './list-charts.component';
+import { SharedTestingModule } from "../../../../shared/shared.module";
describe('ListChartsComponent', () => {
let component: ListChartsComponent;
@@ -19,8 +18,7 @@ describe('ListChartsComponent', () => {
TestBed.configureTestingModule({
declarations: [ListChartsComponent],
imports: [
- ClarityModule,
- TranslateModule.forRoot()
+ SharedTestingModule
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
@@ -30,9 +28,11 @@ describe('ListChartsComponent', () => {
provide: ActivatedRoute, useValue: {
snapshot: {
parent: {
- params: {
- id: 1,
- data: 'chart'
+ parent: {
+ params: {
+ id: 1,
+ },
+ data: null
}
}
}
diff --git a/src/portal/src/app/project/helm-chart/list-charts.component.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.ts
similarity index 72%
rename from src/portal/src/app/project/helm-chart/list-charts.component.ts
rename to src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.ts
index f5dfa879ab..78fe8ce160 100644
--- a/src/portal/src/app/project/helm-chart/list-charts.component.ts
+++ b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.ts
@@ -1,9 +1,9 @@
-import { Project } from '../project';
+import { Project } from '../../project';
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute, Router } from '@angular/router';
-import { SessionService } from '../../shared/session.service';
-import { SessionUser } from '../../shared/session-user';
+import { SessionService } from '../../../../shared/services/session.service';
+import { SessionUser } from '../../../../shared/entities/session-user';
@Component({
@@ -26,11 +26,11 @@ export class ListChartsComponent implements OnInit {
private session: SessionService) {}
ngOnInit() {
- // Get projectId from route params snapshot.
- this.projectId = +this.route.snapshot.parent.params["id"];
+ // Get projectId from router-guard params snapshot.
+ this.projectId = +this.route.snapshot.parent.parent.params["id"];
// Get current user from registered resolver.
this.currentUser = this.session.getCurrentUser();
- let resolverData = this.route.snapshot.parent.data;
+ let resolverData = this.route.snapshot.parent.parent.data;
if (resolverData) {
let project = (resolverData["projectResolver"]);
this.projectName = project.name;
diff --git a/src/portal/src/app/project/member/add-group/add-group.component.html b/src/portal/src/app/base/project/member/add-group/add-group.component.html
similarity index 100%
rename from src/portal/src/app/project/member/add-group/add-group.component.html
rename to src/portal/src/app/base/project/member/add-group/add-group.component.html
diff --git a/src/portal/src/app/project/member/add-group/add-group.component.scss b/src/portal/src/app/base/project/member/add-group/add-group.component.scss
similarity index 100%
rename from src/portal/src/app/project/member/add-group/add-group.component.scss
rename to src/portal/src/app/base/project/member/add-group/add-group.component.scss
diff --git a/src/portal/src/app/project/member/add-group/add-group.component.spec.ts b/src/portal/src/app/base/project/member/add-group/add-group.component.spec.ts
similarity index 85%
rename from src/portal/src/app/project/member/add-group/add-group.component.spec.ts
rename to src/portal/src/app/base/project/member/add-group/add-group.component.spec.ts
index 62c33e47f8..1c23c19140 100644
--- a/src/portal/src/app/project/member/add-group/add-group.component.spec.ts
+++ b/src/portal/src/app/base/project/member/add-group/add-group.component.spec.ts
@@ -4,10 +4,10 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { FormsModule } from '@angular/forms';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AddGroupComponent } from './add-group.component';
-import { GroupService } from "../../../group/group.service";
+import { GroupService } from "../../../left-side-nav/group/group.service";
import { MemberService } from "../member.service";
-import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
-import { OperationService } from "../../../../lib/components/operation/operation.service";
+import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
+import { OperationService } from "../../../../shared/components/operation/operation.service";
describe('AddGroupComponent', () => {
let component: AddGroupComponent;
diff --git a/src/portal/src/app/project/member/add-group/add-group.component.ts b/src/portal/src/app/base/project/member/add-group/add-group.component.ts
similarity index 89%
rename from src/portal/src/app/project/member/add-group/add-group.component.ts
rename to src/portal/src/app/base/project/member/add-group/add-group.component.ts
index d6a5f6bc6b..610e2d18a0 100644
--- a/src/portal/src/app/project/member/add-group/add-group.component.ts
+++ b/src/portal/src/app/base/project/member/add-group/add-group.component.ts
@@ -4,16 +4,16 @@ import { ChangeDetectorRef, ChangeDetectionStrategy, ViewChild } from "@angular/
import { Component, OnInit, Input, Output, EventEmitter } from "@angular/core";
import { NgForm } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
-import { UserGroup } from "./../../../group/group";
-import { MemberService } from "./../member.service";
-import { GroupService } from "../../../group/group.service";
-import { ProjectRoles } from "../../../shared/shared.const";
-import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
+import { UserGroup } from "../../../left-side-nav/group/group";
+import { MemberService } from "../member.service";
+import { GroupService } from "../../../left-side-nav/group/group.service";
+import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
import { Member } from "../member";
import { throwError as observableThrowError } from "rxjs";
-import { OperationService } from "../../../../lib/components/operation/operation.service";
-import { operateChanges, OperateInfo, OperationState } from "../../../../lib/components/operation/operate";
-import { errorHandler } from "../../../../lib/utils/shared/shared.utils";
+import { OperationService } from "../../../../shared/components/operation/operation.service";
+import { operateChanges, OperateInfo, OperationState } from "../../../../shared/components/operation/operate";
+import { ProjectRoles } from "../../../../shared/entities/shared.const";
+import { errorHandler } from "../../../../shared/units/shared.utils";
@Component({
selector: "add-group",
templateUrl: "./add-group.component.html",
diff --git a/src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.html b/src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.html
similarity index 100%
rename from src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.html
rename to src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.html
diff --git a/src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.scss b/src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.scss
similarity index 100%
rename from src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.scss
rename to src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.scss
diff --git a/src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.spec.ts b/src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.spec.ts
similarity index 78%
rename from src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.spec.ts
rename to src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.spec.ts
index 7ff50d532b..f7f33c6976 100644
--- a/src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.spec.ts
+++ b/src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.spec.ts
@@ -1,12 +1,11 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { of } from "rxjs";
import { MemberService } from '../member.service';
-import { AppConfigService } from "../../../services/app-config.service";
-import { ClarityModule } from '@clr/angular';
+import { AppConfigService } from "../../../../services/app-config.service";
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { TranslateModule, TranslateService } from '@ngx-translate/core';
+import { TranslateService } from '@ngx-translate/core';
import { AddHttpAuthGroupComponent } from './add-http-auth-group.component';
-import { HarborLibraryModule } from "../../../../lib/harbor-library.module";
+import { SharedTestingModule } from "../../../../shared/shared.module";
describe('AddHttpAuthGroupComponent', () => {
let component: AddHttpAuthGroupComponent;
@@ -28,9 +27,7 @@ describe('AddHttpAuthGroupComponent', () => {
CUSTOM_ELEMENTS_SCHEMA
],
imports: [
- ClarityModule,
- HarborLibraryModule,
- TranslateModule.forRoot()
+ SharedTestingModule
],
providers: [
TranslateService,
diff --git a/src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.ts b/src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.ts
similarity index 85%
rename from src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.ts
rename to src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.ts
index d563aa02d2..0ef4a6e0fa 100644
--- a/src/portal/src/app/project/member/add-http-auth-group/add-http-auth-group.component.ts
+++ b/src/portal/src/app/base/project/member/add-http-auth-group/add-http-auth-group.component.ts
@@ -22,14 +22,14 @@ import {
} from '@angular/core';
import { NgForm } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
-import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component';
-import { UserService } from '../../../user/user.service';
+import { UserService } from '../../../left-side-nav/user/user.service';
import { MemberService } from '../member.service';
-import { UserGroup } from "../../../group/group";
-import { AppConfigService } from "../../../services/app-config.service";
-import { ProjectRootInterface } from "../../../../lib/services";
-import { GroupType, PROJECT_ROOTS } from "../../../../lib/entities/shared.const";
-import { errorHandler } from "../../../../lib/utils/shared/shared.utils";
+import { UserGroup } from "../../../left-side-nav/group/group";
+import { AppConfigService } from "../../../../services/app-config.service";
+import { ProjectRootInterface } from "../../../../shared/services";
+import { GroupType, PROJECT_ROOTS } from "../../../../shared/entities/shared.const";
+import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component";
+import { errorHandler } from "../../../../shared/units/shared.utils";
@Component({
diff --git a/src/portal/src/app/project/member/add-member/add-member.component.html b/src/portal/src/app/base/project/member/add-member/add-member.component.html
similarity index 100%
rename from src/portal/src/app/project/member/add-member/add-member.component.html
rename to src/portal/src/app/base/project/member/add-member/add-member.component.html
diff --git a/src/portal/src/app/project/member/add-member/add-member.component.scss b/src/portal/src/app/base/project/member/add-member/add-member.component.scss
similarity index 100%
rename from src/portal/src/app/project/member/add-member/add-member.component.scss
rename to src/portal/src/app/base/project/member/add-member/add-member.component.scss
diff --git a/src/portal/src/app/project/member/add-member/add-member.component.spec.ts b/src/portal/src/app/base/project/member/add-member/add-member.component.spec.ts
similarity index 65%
rename from src/portal/src/app/project/member/add-member/add-member.component.spec.ts
rename to src/portal/src/app/base/project/member/add-member/add-member.component.spec.ts
index b7ec173dcb..815ee8f391 100644
--- a/src/portal/src/app/project/member/add-member/add-member.component.spec.ts
+++ b/src/portal/src/app/base/project/member/add-member/add-member.component.spec.ts
@@ -1,18 +1,12 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { AddMemberComponent } from './add-member.component';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
-import { ClarityModule } from '@clr/angular';
-import { FormsModule } from '@angular/forms';
-import { RouterTestingModule } from '@angular/router/testing';
-import { HttpClientTestingModule } from "@angular/common/http/testing";
import { MemberService } from '../member.service';
-import { UserService } from '../../../user/user.service';
+import { UserService } from '../../../left-side-nav/user/user.service';
import { of } from 'rxjs';
-import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
+import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
import { ActivatedRoute } from '@angular/router';
-import { ErrorHandler } from '../../../../lib/utils/error-handler';
+import { SharedTestingModule } from "../../../../shared/shared.module";
describe('AddMemberComponent', () => {
let component: AddMemberComponent;
@@ -41,29 +35,23 @@ describe('AddMemberComponent', () => {
CUSTOM_ELEMENTS_SCHEMA
],
imports: [
- BrowserAnimationsModule,
- ClarityModule,
- TranslateModule.forRoot(),
- FormsModule,
- RouterTestingModule,
- NoopAnimationsModule,
- HttpClientTestingModule
+ SharedTestingModule
],
declarations: [AddMemberComponent],
providers: [
- TranslateService,
{ provide: MemberService, useValue: mockMemberService },
{ provide: UserService, useValue: mockUserService },
{ provide: MessageHandlerService, useValue: mockMessageHandlerService },
- ErrorHandler,
{
provide: ActivatedRoute, useValue: {
RouterparamMap: of({ get: (key) => 'value' }),
snapshot: {
parent: {
- params: { id: 1 }
+ parent: {
+ params: { id: 1 },
+ data: null
+ }
},
- data: 1
}
}
}
diff --git a/src/portal/src/app/project/member/add-member/add-member.component.ts b/src/portal/src/app/base/project/member/add-member/add-member.component.ts
similarity index 83%
rename from src/portal/src/app/project/member/add-member/add-member.component.ts
rename to src/portal/src/app/base/project/member/add-member/add-member.component.ts
index 06395d3eb6..563cceba15 100644
--- a/src/portal/src/app/project/member/add-member/add-member.component.ts
+++ b/src/portal/src/app/base/project/member/add-member/add-member.component.ts
@@ -20,24 +20,20 @@ import {
ViewChild,
AfterViewChecked,
OnInit,
- OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef
+ OnDestroy,
} from '@angular/core';
import { NgForm } from '@angular/forms';
-import {ActivatedRoute} from "@angular/router";
+import { ActivatedRoute } from "@angular/router";
import { Subject, forkJoin } from "rxjs";
-
-
-
import { TranslateService } from '@ngx-translate/core';
-
-import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
-import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component';
-import { UserService } from '../../../user/user.service';
-import {User} from "../../../user/user";
-import {Project} from "../../project";
+import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
+import { UserService } from '../../../left-side-nav/user/user.service';
+import { User } from "../../../left-side-nav/user/user";
+import { Project } from "../../project";
import { Member } from '../member';
import { MemberService } from '../member.service';
-import { ErrorHandler } from '../../../../lib/utils/error-handler';
+import { ErrorHandler } from '../../../../shared/units/error-handler';
+import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component";
@Component({
@@ -45,7 +41,6 @@ import { ErrorHandler } from '../../../../lib/utils/error-handler';
templateUrl: 'add-member.component.html',
styleUrls: ['add-member.component.scss'],
providers: [UserService],
- changeDetection: ChangeDetectionStrategy.Default
})
export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
@@ -82,11 +77,10 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
private errorHandle: ErrorHandler,
private messageHandlerService: MessageHandlerService,
private translateService: TranslateService,
- private route: ActivatedRoute,
- private ref: ChangeDetectorRef) { }
+ private route: ActivatedRoute) { }
ngOnInit(): void {
- let resolverData = this.route.snapshot.parent.data;
+ let resolverData = this.route.snapshot.parent.parent.data;
let hasProjectAdminRole: boolean;
if (resolverData) {
hasProjectAdminRole = (resolverData['projectResolver']).has_project_admin_role;
@@ -101,7 +95,6 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
this.isMemberNameValid = cont.valid;
if (cont.valid) {
this.checkOnGoing = true;
- this.ref.detectChanges();
forkJoin(this.userService.getUsersNameList(cont.value, 20), this.memberService
.listMembers(this.projectId, cont.value)).subscribe((res: Array) => {
this.userLists = res[0];
@@ -120,13 +113,8 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
}
});
}
- let changeTimer = setInterval(() => this.ref.detectChanges(), 200);
- setTimeout(() => {
- clearInterval(changeTimer);
- }, 2000);
}, error => {
this.checkOnGoing = false;
- this.ref.detectChanges();
});
} else {
this.memberTooltip = 'MEMBER.USERNAME_IS_REQUIRED';
@@ -147,11 +135,6 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
finalize(() => {
this.addMemberOpened = false;
this.member.role_id = null;
-
- let changeTimer = setInterval(() => this.ref.detectChanges(), 200);
- setTimeout(() => {
- clearInterval(changeTimer);
- }, 2000);
}
))
.subscribe(
diff --git a/src/portal/src/app/project/member/member.component.html b/src/portal/src/app/base/project/member/member.component.html
similarity index 100%
rename from src/portal/src/app/project/member/member.component.html
rename to src/portal/src/app/base/project/member/member.component.html
diff --git a/src/portal/src/app/project/member/member.component.scss b/src/portal/src/app/base/project/member/member.component.scss
similarity index 100%
rename from src/portal/src/app/project/member/member.component.scss
rename to src/portal/src/app/base/project/member/member.component.scss
diff --git a/src/portal/src/app/project/member/member.component.spec.ts b/src/portal/src/app/base/project/member/member.component.spec.ts
similarity index 71%
rename from src/portal/src/app/project/member/member.component.spec.ts
rename to src/portal/src/app/base/project/member/member.component.spec.ts
index 71baed5fbf..c391f6cc93 100644
--- a/src/portal/src/app/project/member/member.component.spec.ts
+++ b/src/portal/src/app/base/project/member/member.component.spec.ts
@@ -1,22 +1,17 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { MemberComponent } from './member.component';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
-import { ClarityModule } from '@clr/angular';
-import { FormsModule } from '@angular/forms';
-import { RouterTestingModule } from '@angular/router/testing';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ActivatedRoute } from "@angular/router";
-import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
-import { ConfirmationDialogService } from "../../shared/confirmation-dialog/confirmation-dialog.service";
-import { SessionService } from "../../shared/session.service";
+import { MessageHandlerService } from "../../../shared/services/message-handler.service";
+import { SessionService } from "../../../shared/services/session.service";
import { MemberService } from "./member.service";
-import { AppConfigService } from "../../services/app-config.service";
+import { AppConfigService } from "../../../services/app-config.service";
import { of } from 'rxjs';
-import { OperationService } from "../../../lib/components/operation/operation.service";
-import { UserPermissionService } from "../../../lib/services";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
+import { OperationService } from "../../../shared/components/operation/operation.service";
+import { UserPermissionService } from "../../../shared/services";
+import { ErrorHandler } from "../../../shared/units/error-handler";
+import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service";
+import { SharedTestingModule } from "../../../shared/shared.module";
describe('MemberComponent', () => {
let component: MemberComponent;
@@ -85,17 +80,10 @@ describe('MemberComponent', () => {
CUSTOM_ELEMENTS_SCHEMA
],
imports: [
- BrowserAnimationsModule,
- ClarityModule,
- TranslateModule.forRoot(),
- FormsModule,
- RouterTestingModule,
- NoopAnimationsModule,
- HttpClientTestingModule
+ SharedTestingModule
],
declarations: [MemberComponent],
providers: [
- TranslateService,
{ provide: MemberService, useValue: mockMemberService },
{ provide: MessageHandlerService, useValue: mockMessageHandlerService },
{ provide: ConfirmationDialogService, useValue: mockConfirmationDialogService },
@@ -109,9 +97,10 @@ describe('MemberComponent', () => {
RouterparamMap: of({ get: (key) => 'value' }),
snapshot: {
parent: {
- params: { id: 1 }
+ parent: {
+ params: { id: 1 }
+ }
},
- data: 1
}
}
}
diff --git a/src/portal/src/app/project/member/member.component.ts b/src/portal/src/app/base/project/member/member.component.ts
similarity index 85%
rename from src/portal/src/app/project/member/member.component.ts
rename to src/portal/src/app/base/project/member/member.component.ts
index abbeb623c5..6e2850d22b 100644
--- a/src/portal/src/app/project/member/member.component.ts
+++ b/src/portal/src/app/base/project/member/member.component.ts
@@ -12,34 +12,37 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { finalize } from 'rxjs/operators';
-import { Component, OnInit, ViewChild, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef } from "@angular/core";
+import { Component, OnInit, ViewChild, OnDestroy } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Subscription, forkJoin, Observable } from "rxjs";
import { TranslateService } from "@ngx-translate/core";
-import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
-import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from "../../shared/shared.const";
-import { ConfirmationDialogService } from "../../shared/confirmation-dialog/confirmation-dialog.service";
-import { ConfirmationMessage } from "../../shared/confirmation-dialog/confirmation-message";
-import { SessionService } from "../../shared/session.service";
-import { RoleInfo } from "../../shared/shared.const";
+import { MessageHandlerService } from "../../../shared/services/message-handler.service";
+import { SessionService } from "../../../shared/services/session.service";
import { Member } from "./member";
-import { SessionUser } from "../../shared/session-user";
+import { SessionUser } from "../../../shared/entities/session-user";
import { AddGroupComponent } from './add-group/add-group.component';
import { AddHttpAuthGroupComponent } from './add-http-auth-group/add-http-auth-group.component';
import { MemberService } from "./member.service";
import { AddMemberComponent } from "./add-member/add-member.component";
-import { AppConfigService } from "../../services/app-config.service";
+import { AppConfigService } from "../../../services/app-config.service";
import { map, catchError } from "rxjs/operators";
import { throwError as observableThrowError } from "rxjs";
-import { OperationService } from "../../../lib/components/operation/operation.service";
-import { UserPermissionService, USERSTATICPERMISSION } from "../../../lib/services";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
-import { operateChanges, OperateInfo, OperationState } from "../../../lib/components/operation/operate";
-import { errorHandler as errorHandlerFn } from "../../../lib/utils/shared/shared.utils";
+import { OperationService } from "../../../shared/components/operation/operation.service";
+import { UserPermissionService, USERSTATICPERMISSION } from "../../../shared/services";
+import { ErrorHandler } from "../../../shared/units/error-handler";
+import { operateChanges, OperateInfo, OperationState } from "../../../shared/components/operation/operate";
+import {
+ ConfirmationButtons,
+ ConfirmationState,
+ ConfirmationTargets,
+ RoleInfo
+} from "../../../shared/entities/shared.const";
+import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service";
+import { errorHandler } from "../../../shared/units/shared.utils";
+import { ConfirmationMessage } from "../../global-confirmation-dialog/confirmation-message";
@Component({
templateUrl: "member.component.html",
styleUrls: ["./member.component.scss"],
- changeDetection: ChangeDetectionStrategy.OnPush
})
export class MemberComponent implements OnInit, OnDestroy {
@@ -84,9 +87,7 @@ export class MemberComponent implements OnInit, OnDestroy {
private operationService: OperationService,
private appConfigService: AppConfigService,
private userPermissionService: UserPermissionService,
- private errorHandler: ErrorHandler,
- private ref: ChangeDetectorRef) {
-
+ private errorHandlerEntity: ErrorHandler) {
this.delSub = OperateDialogService.confirmationConfirm$.subscribe(message => {
if (message &&
message.state === ConfirmationState.CONFIRMED &&
@@ -96,8 +97,6 @@ export class MemberComponent implements OnInit, OnDestroy {
}
}
});
- let hnd = setInterval(() => ref.markForCheck(), 100);
- setTimeout(() => clearInterval(hnd), 1000);
}
ngOnDestroy() {
@@ -107,8 +106,8 @@ export class MemberComponent implements OnInit, OnDestroy {
}
ngOnInit() {
- // Get projectId from route params snapshot.
- this.projectId = +this.route.snapshot.parent.params["id"];
+ // Get projectId from router-guard params snapshot.
+ this.projectId = +this.route.snapshot.parent.parent.params["id"];
// Get current user from registered resolver.
this.currentUser = this.session.getCurrentUser();
this.retrieve(this.projectId, "");
@@ -140,8 +139,6 @@ export class MemberComponent implements OnInit, OnDestroy {
.listMembers(projectId, username).pipe(
finalize(() => {
this.loading = false;
- let hnd = setInterval(() => this.ref.markForCheck(), 100);
- setTimeout(() => clearInterval(hnd), 1000);
}))
.subscribe(
response => {
@@ -274,7 +271,7 @@ export class MemberComponent implements OnInit, OnDestroy {
operateChanges(operMessage, OperationState.success);
});
}), catchError(error => {
- const message = errorHandlerFn(error);
+ const message = errorHandler(error);
this.translate.get(message).subscribe(res =>
operateChanges(operMessage, OperationState.failure, res)
);
@@ -290,7 +287,7 @@ export class MemberComponent implements OnInit, OnDestroy {
this.batchOps = 'idle';
this.retrieve(this.projectId, "");
}, error => {
- this.errorHandler.error(error);
+ this.errorHandlerEntity.error(error);
});
}
getMemberPermissionRule(projectId: number): void {
@@ -304,6 +301,6 @@ export class MemberComponent implements OnInit, OnDestroy {
this.hasCreateMemberPermission = MemberRule[0] as boolean;
this.hasUpdateMemberPermission = MemberRule[1] as boolean;
this.hasDeleteMemberPermission = MemberRule[2] as boolean;
- }, error => this.errorHandler.error(error));
+ }, error => this.errorHandlerEntity.error(error));
}
}
diff --git a/src/portal/src/app/base/project/member/member.module.ts b/src/portal/src/app/base/project/member/member.module.ts
new file mode 100644
index 0000000000..4e9ece9cba
--- /dev/null
+++ b/src/portal/src/app/base/project/member/member.module.ts
@@ -0,0 +1,31 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { MemberComponent } from "./member.component";
+import { AddMemberComponent } from "./add-member/add-member.component";
+import { AddHttpAuthGroupComponent } from "./add-http-auth-group/add-http-auth-group.component";
+import { AddGroupComponent } from "./add-group/add-group.component";
+import { MemberService } from "./member.service";
+
+const routes: Routes = [
+ {
+ path: '',
+ component: MemberComponent
+ }
+];
+@NgModule({
+ declarations: [
+ MemberComponent,
+ AddMemberComponent,
+ AddHttpAuthGroupComponent,
+ AddGroupComponent
+ ],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ],
+ providers: [
+ MemberService
+ ]
+})
+export class MemberModule { }
diff --git a/src/portal/src/app/project/member/member.service.spec.ts b/src/portal/src/app/base/project/member/member.service.spec.ts
similarity index 100%
rename from src/portal/src/app/project/member/member.service.spec.ts
rename to src/portal/src/app/base/project/member/member.service.spec.ts
diff --git a/src/portal/src/app/project/member/member.service.ts b/src/portal/src/app/base/project/member/member.service.ts
similarity index 96%
rename from src/portal/src/app/project/member/member.service.ts
rename to src/portal/src/app/base/project/member/member.service.ts
index b1d34d4c1d..a5e02454cb 100644
--- a/src/portal/src/app/project/member/member.service.ts
+++ b/src/portal/src/app/base/project/member/member.service.ts
@@ -13,11 +13,11 @@
// limitations under the License.
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
-import { User } from '../../user/user';
+import { User } from '../../left-side-nav/user/user';
import { Member } from './member';
import {throwError as observableThrowError, Observable } from "rxjs";
import {map, catchError} from 'rxjs/operators';
-import { CURRENT_BASE_HREF, HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../../lib/utils/utils";
+import { CURRENT_BASE_HREF, HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../../shared/units/utils";
@Injectable()
export class MemberService {
diff --git a/src/portal/src/app/project/member/member.ts b/src/portal/src/app/base/project/member/member.ts
similarity index 100%
rename from src/portal/src/app/project/member/member.ts
rename to src/portal/src/app/base/project/member/member.ts
diff --git a/src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.html b/src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.html
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.html
rename to src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.html
diff --git a/src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.scss b/src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.scss
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.scss
rename to src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.scss
diff --git a/src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.spec.ts b/src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.spec.ts
similarity index 92%
rename from src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.spec.ts
rename to src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.spec.ts
index 37477c3222..c61b041dcb 100644
--- a/src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.spec.ts
+++ b/src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.spec.ts
@@ -8,15 +8,15 @@ import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { AddP2pPolicyComponent } from './add-p2p-policy.component';
import { P2pProviderService } from '../p2p-provider.service';
-import { ErrorHandler } from '../../../../lib/utils/error-handler';
-import { PreheatService } from '../../../../../ng-swagger-gen/services/preheat.service';
+import { ErrorHandler } from '../../../../shared/units/error-handler';
+import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service';
import { ActivatedRoute } from '@angular/router';
-import { SessionService } from '../../../shared/session.service';
-import { AppConfigService } from '../../../services/app-config.service';
-import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component';
+import { SessionService } from '../../../../shared/services/session.service';
+import { AppConfigService } from '../../../../services/app-config.service';
import { of } from 'rxjs';
import { delay } from 'rxjs/operators';
-import { ProjectService } from '../../../../lib/services';
+import { ProjectService } from '../../../../shared/services';
+import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component";
describe('AddP2pPolicyComponent', () => {
let component: AddP2pPolicyComponent;
let fixture: ComponentFixture;
diff --git a/src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.ts b/src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.ts
similarity index 93%
rename from src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.ts
rename to src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.ts
index 83ad9de964..b25b216de4 100644
--- a/src/portal/src/app/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.ts
+++ b/src/portal/src/app/base/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.ts
@@ -1,20 +1,20 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild, } from '@angular/core';
-import { PreheatPolicy } from '../../../../../ng-swagger-gen/models/preheat-policy';
-import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component';
+import { PreheatPolicy } from '../../../../../../ng-swagger-gen/models/preheat-policy';
import { NgForm } from '@angular/forms';
-import { OriginCron, ProjectService } from '../../../../lib/services';
-import { CronScheduleComponent } from '../../../../lib/components/cron-schedule';
-import { PreheatService } from '../../../../../ng-swagger-gen/services/preheat.service';
+import { OriginCron, ProjectService } from '../../../../shared/services';
+import { CronScheduleComponent } from '../../../../shared/components/cron-schedule';
+import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service';
import { debounceTime, distinctUntilChanged, filter, finalize, switchMap } from 'rxjs/operators';
-import { deleteEmptyKey } from '../../../../lib/utils/utils';
+import { deleteEmptyKey } from '../../../../shared/units/utils';
import { ClrLoadingState } from '@clr/angular';
-import { SessionService } from '../../../shared/session.service';
+import { SessionService } from '../../../../shared/services/session.service';
import { Project } from '../../project';
import { ActivatedRoute } from '@angular/router';
import { FILTER_TYPE, PROJECT_SEVERITY_LEVEL_MAP, TRIGGER, TRIGGER_I18N_MAP } from '../p2p-provider.service';
-import { ProviderUnderProject } from '../../../../../ng-swagger-gen/models/provider-under-project';
-import { AppConfigService } from '../../../services/app-config.service';
+import { ProviderUnderProject } from '../../../../../../ng-swagger-gen/models/provider-under-project';
+import { AppConfigService } from '../../../../services/app-config.service';
import { Subject, Subscription } from 'rxjs';
+import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component";
const SCHEDULE_TYPE = {
NONE: "None",
diff --git a/src/portal/src/app/base/project/p2p-provider/p2p-provider.module.ts b/src/portal/src/app/base/project/p2p-provider/p2p-provider.module.ts
new file mode 100644
index 0000000000..52eb05ccf6
--- /dev/null
+++ b/src/portal/src/app/base/project/p2p-provider/p2p-provider.module.ts
@@ -0,0 +1,35 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { TaskListComponent } from "./task-list/task-list.component";
+import { PolicyComponent } from "./policy/policy.component";
+import { AddP2pPolicyComponent } from "./add-p2p-policy/add-p2p-policy.component";
+import { P2pProviderService } from "./p2p-provider.service";
+
+
+const routes: Routes = [
+ {
+ path: 'policies',
+ component: PolicyComponent
+ },
+ {
+ path: ':preheatPolicyName/executions/:executionId/tasks',
+ component: TaskListComponent
+ },
+ { path: '', redirectTo: 'policies', pathMatch: 'full' }
+];
+@NgModule({
+ declarations: [
+ TaskListComponent,
+ PolicyComponent,
+ AddP2pPolicyComponent
+ ],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ],
+ providers: [
+ P2pProviderService
+ ]
+})
+export class P2pProviderModule { }
diff --git a/src/portal/src/app/project/p2p-provider/p2p-provider.service.spec.ts b/src/portal/src/app/base/project/p2p-provider/p2p-provider.service.spec.ts
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/p2p-provider.service.spec.ts
rename to src/portal/src/app/base/project/p2p-provider/p2p-provider.service.spec.ts
diff --git a/src/portal/src/app/project/p2p-provider/p2p-provider.service.ts b/src/portal/src/app/base/project/p2p-provider/p2p-provider.service.ts
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/p2p-provider.service.ts
rename to src/portal/src/app/base/project/p2p-provider/p2p-provider.service.ts
diff --git a/src/portal/src/app/project/p2p-provider/policy/policy.component.html b/src/portal/src/app/base/project/p2p-provider/policy/policy.component.html
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/policy/policy.component.html
rename to src/portal/src/app/base/project/p2p-provider/policy/policy.component.html
diff --git a/src/portal/src/app/project/p2p-provider/policy/policy.component.scss b/src/portal/src/app/base/project/p2p-provider/policy/policy.component.scss
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/policy/policy.component.scss
rename to src/portal/src/app/base/project/p2p-provider/policy/policy.component.scss
diff --git a/src/portal/src/app/project/p2p-provider/policy/policy.component.spec.ts b/src/portal/src/app/base/project/p2p-provider/policy/policy.component.spec.ts
similarity index 88%
rename from src/portal/src/app/project/p2p-provider/policy/policy.component.spec.ts
rename to src/portal/src/app/base/project/p2p-provider/policy/policy.component.spec.ts
index 9121bc9fd1..ec791869fb 100644
--- a/src/portal/src/app/project/p2p-provider/policy/policy.component.spec.ts
+++ b/src/portal/src/app/base/project/p2p-provider/policy/policy.component.spec.ts
@@ -1,7 +1,7 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { TranslateModule } from '@ngx-translate/core';
import { ActivatedRoute } from '@angular/router';
-import { MessageHandlerService } from "../../../shared/message-handler/message-handler.service";
+import { MessageHandlerService } from "../../../../shared/services/message-handler.service";
import { of } from 'rxjs';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
@@ -10,19 +10,19 @@ import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { delay } from "rxjs/operators";
-import { InlineAlertComponent } from "../../../shared/inline-alert/inline-alert.component";
-import { ConfirmationDialogComponent } from "../../../../lib/components/confirmation-dialog";
-import { ProjectService, UserPermissionService } from '../../../../lib/services';
+import { ConfirmationDialogComponent } from "../../../../shared/components/confirmation-dialog";
+import { ProjectService, UserPermissionService } from '../../../../shared/services';
import { PolicyComponent } from './policy.component';
-import { PreheatService } from '../../../../../ng-swagger-gen/services/preheat.service';
+import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service';
import { AddP2pPolicyComponent } from '../add-p2p-policy/add-p2p-policy.component';
-import { PreheatPolicy } from '../../../../../ng-swagger-gen/models/preheat-policy';
-import { Execution } from '../../../../../ng-swagger-gen/models/execution';
-import { ProviderUnderProject } from '../../../../../ng-swagger-gen/models/provider-under-project';
+import { PreheatPolicy } from '../../../../../../ng-swagger-gen/models/preheat-policy';
+import { Execution } from '../../../../../../ng-swagger-gen/models/execution';
+import { ProviderUnderProject } from '../../../../../../ng-swagger-gen/models/provider-under-project';
import { P2pProviderService } from '../p2p-provider.service';
-import { SessionService } from '../../../shared/session.service';
-import { AppConfigService } from '../../../services/app-config.service';
-import { ErrorHandler } from '../../../../lib/utils/error-handler';
+import { SessionService } from '../../../../shared/services/session.service';
+import { AppConfigService } from '../../../../services/app-config.service';
+import { ErrorHandler } from '../../../../shared/units/error-handler';
+import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component";
describe('PolicyComponent', () => {
let component: PolicyComponent;
diff --git a/src/portal/src/app/project/p2p-provider/policy/policy.component.ts b/src/portal/src/app/base/project/p2p-provider/policy/policy.component.ts
similarity index 94%
rename from src/portal/src/app/project/p2p-provider/policy/policy.component.ts
rename to src/portal/src/app/base/project/p2p-provider/policy/policy.component.ts
index cd14b84be9..d7c1679844 100644
--- a/src/portal/src/app/project/p2p-provider/policy/policy.component.ts
+++ b/src/portal/src/app/base/project/p2p-provider/policy/policy.component.ts
@@ -11,22 +11,19 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-import { debounceTime, distinctUntilChanged, finalize, switchMap } from 'rxjs/operators';
+import { debounceTime, finalize, switchMap } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
-import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
+import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
import { Project } from '../../project';
-import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from '../../../shared/shared.const';
-import { ConfirmationMessage } from '../../../shared/confirmation-dialog/confirmation-message';
-import { ConfirmationDialogComponent } from '../../../shared/confirmation-dialog/confirmation-dialog.component';
-import {clone, CustomComparator, DEFAULT_PAGE_SIZE} from '../../../../lib/utils/utils';
+import { clone, CustomComparator, DEFAULT_PAGE_SIZE } from '../../../../shared/units/utils';
import { forkJoin, Observable, Subject, Subscription } from 'rxjs';
import {
ClrDatagridComparatorInterface,
UserPermissionService,
USERSTATICPERMISSION
-} from '../../../../lib/services';
+} from '../../../../shared/services';
import {ClrDatagridStateInterface, ClrLoadingState} from '@clr/angular';
import {
EXECUTION_STATUS,
@@ -37,12 +34,15 @@ import {
TRIGGER,
TRIGGER_I18N_MAP
} from '../p2p-provider.service';
-import { PreheatPolicy } from '../../../../../ng-swagger-gen/models/preheat-policy';
-import { PreheatService } from '../../../../../ng-swagger-gen/services/preheat.service';
+import { PreheatPolicy } from '../../../../../../ng-swagger-gen/models/preheat-policy';
+import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service';
import { AddP2pPolicyComponent } from '../add-p2p-policy/add-p2p-policy.component';
-import { Execution } from '../../../../../ng-swagger-gen/models/execution';
-import { Metrics } from '../../../../../ng-swagger-gen/models/metrics';
-import { ProviderUnderProject } from '../../../../../ng-swagger-gen/models/provider-under-project';
+import { Execution } from '../../../../../../ng-swagger-gen/models/execution';
+import { Metrics } from '../../../../../../ng-swagger-gen/models/metrics';
+import { ProviderUnderProject } from '../../../../../../ng-swagger-gen/models/provider-under-project';
+import { ConfirmationDialogComponent } from "../../../../shared/components/confirmation-dialog";
+import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../../shared/entities/shared.const";
+import { ConfirmationMessage } from "../../../global-confirmation-dialog/confirmation-message";
@Component({
templateUrl: './policy.component.html',
diff --git a/src/portal/src/app/project/p2p-provider/task-list/task-list.component.html b/src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.html
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/task-list/task-list.component.html
rename to src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.html
diff --git a/src/portal/src/app/project/p2p-provider/task-list/task-list.component.scss b/src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.scss
similarity index 100%
rename from src/portal/src/app/project/p2p-provider/task-list/task-list.component.scss
rename to src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.scss
diff --git a/src/portal/src/app/project/p2p-provider/task-list/task-list.component.spec.ts b/src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.spec.ts
similarity index 88%
rename from src/portal/src/app/project/p2p-provider/task-list/task-list.component.spec.ts
rename to src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.spec.ts
index 07c7192c44..038e03adba 100644
--- a/src/portal/src/app/project/p2p-provider/task-list/task-list.component.spec.ts
+++ b/src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.spec.ts
@@ -7,16 +7,16 @@ import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { P2pProviderService } from '../p2p-provider.service';
-import { PreheatService } from '../../../../../ng-swagger-gen/services/preheat.service';
+import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service';
import { ActivatedRoute } from '@angular/router';
-import { SessionService } from '../../../shared/session.service';
+import { SessionService } from '../../../../shared/services/session.service';
import { of } from 'rxjs';
import { delay } from 'rxjs/operators';
-import { Execution } from '../../../../../ng-swagger-gen/models/execution';
+import { Execution } from '../../../../../../ng-swagger-gen/models/execution';
import { TaskListComponent } from './task-list.component';
-import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
-import { UserPermissionService } from '../../../../lib/services';
-import { Task } from '../../../../../ng-swagger-gen/models/task';
+import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
+import { UserPermissionService } from '../../../../shared/services';
+import { Task } from '../../../../../../ng-swagger-gen/models/task';
import { HttpHeaders, HttpResponse } from '@angular/common/http';
describe('TaskListComponent', () => {
let component: TaskListComponent;
diff --git a/src/portal/src/app/project/p2p-provider/task-list/task-list.component.ts b/src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.ts
similarity index 95%
rename from src/portal/src/app/project/p2p-provider/task-list/task-list.component.ts
rename to src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.ts
index 394852e1e2..c505763999 100644
--- a/src/portal/src/app/project/p2p-provider/task-list/task-list.component.ts
+++ b/src/portal/src/app/base/project/p2p-provider/task-list/task-list.component.ts
@@ -2,16 +2,16 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { debounceTime, finalize, switchMap } from 'rxjs/operators';
-import { clone, DEFAULT_PAGE_SIZE } from '../../../../lib/utils/utils';
-import { Task } from '../../../../../ng-swagger-gen/models/task';
-import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
+import { clone, DEFAULT_PAGE_SIZE } from '../../../../shared/units/utils';
+import { Task } from '../../../../../../ng-swagger-gen/models/task';
+import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
import { Project } from '../../project';
-import { UserPermissionService, USERSTATICPERMISSION } from '../../../../lib/services';
-import { Execution } from '../../../../../ng-swagger-gen/models/execution';
-import { PreheatService } from '../../../../../ng-swagger-gen/services/preheat.service';
+import { UserPermissionService, USERSTATICPERMISSION } from '../../../../shared/services';
+import { Execution } from '../../../../../../ng-swagger-gen/models/execution';
+import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service';
import { EXECUTION_STATUS, P2pProviderService, TIME_OUT } from '../p2p-provider.service';
import { forkJoin, Observable, Subject, Subscription } from 'rxjs';
-import {ClrDatagridStateInterface, ClrLoadingState} from '@clr/angular';
+import { ClrDatagridStateInterface, ClrLoadingState } from '@clr/angular';
@Component({
selector: 'task-list',
diff --git a/src/portal/src/app/project/project-config/project-config.component.html b/src/portal/src/app/base/project/project-config/project-config.component.html
similarity index 100%
rename from src/portal/src/app/project/project-config/project-config.component.html
rename to src/portal/src/app/base/project/project-config/project-config.component.html
diff --git a/src/portal/src/app/project/project-config/project-config.component.scss b/src/portal/src/app/base/project/project-config/project-config.component.scss
similarity index 100%
rename from src/portal/src/app/project/project-config/project-config.component.scss
rename to src/portal/src/app/base/project/project-config/project-config.component.scss
diff --git a/src/portal/src/app/project/project-config/project-config.component.spec.ts b/src/portal/src/app/base/project/project-config/project-config.component.spec.ts
similarity index 76%
rename from src/portal/src/app/project/project-config/project-config.component.spec.ts
rename to src/portal/src/app/base/project/project-config/project-config.component.spec.ts
index d32c0235b8..3e12996324 100644
--- a/src/portal/src/app/project/project-config/project-config.component.spec.ts
+++ b/src/portal/src/app/base/project/project-config/project-config.component.spec.ts
@@ -1,11 +1,10 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { ClarityModule } from '@clr/angular';
import { ActivatedRoute, Router } from "@angular/router";
-import { SessionService } from '../../shared/session.service';
+import { SessionService } from '../../../shared/services/session.service';
import { of } from 'rxjs';
import { ProjectConfigComponent } from './project-config.component';
+import { SharedTestingModule } from "../../../shared/shared.module";
describe('ProjectConfigComponent', () => {
let component: ProjectConfigComponent;
@@ -24,8 +23,7 @@ describe('ProjectConfigComponent', () => {
CUSTOM_ELEMENTS_SCHEMA
],
imports: [
- ClarityModule,
- TranslateModule.forRoot()
+ SharedTestingModule
],
providers: [
{
@@ -33,19 +31,20 @@ describe('ProjectConfigComponent', () => {
paramMap: of({ get: (key) => 'value' }),
snapshot: {
parent: {
- params: { id: 1, chart: 'chart', version: 1.0 }
- },
- data: {
- projectResolver: {
- role_name: 'admin'
+ parent: {
+ params: { id: 1, chart: 'chart', version: 1.0 },
+ data: {
+ projectResolver: {
+ role_name: 'admin'
+ }
+ }
}
- }
+ },
}
}
},
{ provide: Router, useValue: fakeRouter },
{ provide: SessionService, useValue: fakeSessionService },
- TranslateService
]
}).compileComponents();
}));
diff --git a/src/portal/src/app/project/project-config/project-config.component.ts b/src/portal/src/app/base/project/project-config/project-config.component.ts
similarity index 84%
rename from src/portal/src/app/project/project-config/project-config.component.ts
rename to src/portal/src/app/base/project/project-config/project-config.component.ts
index 36ffdf4eb0..97cf26ca29 100644
--- a/src/portal/src/app/project/project-config/project-config.component.ts
+++ b/src/portal/src/app/base/project/project-config/project-config.component.ts
@@ -13,8 +13,8 @@
// limitations under the License.
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
-import { SessionService } from '../../shared/session.service';
-import { SessionUser } from '../../shared/session-user';
+import { SessionService } from '../../../shared/services/session.service';
+import { SessionUser } from '../../../shared/entities/session-user';
import { Project } from '../project';
@Component({
@@ -35,10 +35,10 @@ export class ProjectConfigComponent implements OnInit {
private session: SessionService) {}
ngOnInit() {
- this.projectId = +this.route.snapshot.parent.params['id'];
+ this.projectId = +this.route.snapshot.parent.parent.params['id'];
this.currentUser = this.session.getCurrentUser();
this.hasSignedIn = this.session.getCurrentUser() !== null;
- let resolverData = this.route.snapshot.parent.data;
+ let resolverData = this.route.snapshot.parent.parent.data;
if (resolverData) {
let pro: Project = resolverData['projectResolver'];
this.projectName = pro.name;
diff --git a/src/portal/src/app/base/project/project-config/project-config.module.ts b/src/portal/src/app/base/project/project-config/project-config.module.ts
new file mode 100644
index 0000000000..e867109fb5
--- /dev/null
+++ b/src/portal/src/app/base/project/project-config/project-config.module.ts
@@ -0,0 +1,23 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { ProjectConfigComponent } from "./project-config.component";
+import { ProjectPolicyConfigComponent } from "./project-policy-config/project-policy-config.component";
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ProjectConfigComponent
+ }
+];
+@NgModule({
+ declarations: [
+ ProjectConfigComponent,
+ ProjectPolicyConfigComponent
+ ],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ]
+})
+export class ProjectConfigModule { }
diff --git a/src/portal/src/lib/components/project-policy-config/project-policy-config.component.html b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html
similarity index 100%
rename from src/portal/src/lib/components/project-policy-config/project-policy-config.component.html
rename to src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html
diff --git a/src/portal/src/lib/components/project-policy-config/project-policy-config.component.scss b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.scss
similarity index 100%
rename from src/portal/src/lib/components/project-policy-config/project-policy-config.component.scss
rename to src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.scss
diff --git a/src/portal/src/lib/components/project-policy-config/project-policy-config.component.spec.ts b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts
similarity index 79%
rename from src/portal/src/lib/components/project-policy-config/project-policy-config.component.spec.ts
rename to src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts
index 5b06969536..222de53b1a 100644
--- a/src/portal/src/lib/components/project-policy-config/project-policy-config.component.spec.ts
+++ b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts
@@ -1,16 +1,15 @@
-import { SystemInfoService } from '../../services/system-info.service';
+import { SystemInfoService } from '../../../../shared/services';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { ErrorHandler } from '../../utils/error-handler/error-handler';
-import { ConfirmationDialogComponent } from '../confirmation-dialog/confirmation-dialog.component';
+import { ErrorHandler } from '../../../../shared/units/error-handler';
+import { ConfirmationDialogComponent } from '../../../../shared/components/confirmation-dialog';
import { ProjectPolicyConfigComponent } from './project-policy-config.component';
-import { SharedModule } from '../../utils/shared/shared.module';
-import { ProjectService } from '../../services/project.service';
-import { SERVICE_CONFIG, IServiceConfig} from '../../entities/service.config';
-import {SystemCVEAllowlist, SystemInfo} from '../../services/interface';
+import { ProjectService } from '../../../../shared/services';
+import {SystemCVEAllowlist, SystemInfo} from '../../../../shared/services';
import { Project } from './project';
-import { UserPermissionService } from '../../services/permission.service';
+import { UserPermissionService } from '../../../../shared/services';
import { of } from 'rxjs';
-import { CURRENT_BASE_HREF } from "../../utils/utils";
+import { CURRENT_BASE_HREF } from "../../../../shared/units/utils";
+import { SharedTestingModule } from "../../../../shared/shared.module";
const mockSystemInfo: SystemInfo[] = [
{
@@ -80,10 +79,6 @@ const mockSystemAllowlist: SystemCVEAllowlist = {
"items": [],
"project_id": 0
};
-const config: IServiceConfig = {
- projectPolicyEndpoint: CURRENT_BASE_HREF + '/projects/testing',
- systemInfoEndpoint: CURRENT_BASE_HREF + '/systeminfo/testing',
-};
const projectService = {
getProject() {
return of(mockProjectPolicies[1]);
@@ -115,7 +110,7 @@ describe('ProjectPolicyConfigComponent', () => {
}
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
- imports: [SharedModule],
+ imports: [SharedTestingModule],
declarations: [
ProjectPolicyConfigComponent,
ConfirmationDialogComponent,
@@ -123,7 +118,6 @@ describe('ProjectPolicyConfigComponent', () => {
],
providers: [
ErrorHandler,
- { provide: SERVICE_CONFIG, useValue: config },
{ provide: ProjectService, useValue: projectService },
{ provide: SystemInfoService, useValue: systemInfoService},
{ provide: UserPermissionService, useValue: userPermissionService},
diff --git a/src/portal/src/lib/components/project-policy-config/project-policy-config.component.ts b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts
similarity index 92%
rename from src/portal/src/lib/components/project-policy-config/project-policy-config.component.ts
rename to src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts
index d6fc20aa90..2a281e499c 100644
--- a/src/portal/src/lib/components/project-policy-config/project-policy-config.component.ts
+++ b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts
@@ -1,20 +1,17 @@
import {Component, ElementRef, Input, OnInit, ViewChild} from '@angular/core';
-
-import {compareValue, clone} from '../../utils/utils';
-import {ProjectService} from '../../services/project.service';
-import {ErrorHandler} from '../../utils/error-handler/error-handler';
-import {State, SystemCVEAllowlist} from '../../services/interface';
-
-import {ConfirmationState, ConfirmationTargets} from '../../entities/shared.const';
-import {ConfirmationMessage} from '../confirmation-dialog/confirmation-message';
-import {ConfirmationDialogComponent} from '../confirmation-dialog/confirmation-dialog.component';
-import {ConfirmationAcknowledgement} from '../confirmation-dialog/confirmation-state-message';
+import {compareValue, clone} from '../../../../shared/units/utils';
+import {ProjectService} from '../../../../shared/services';
+import {ErrorHandler} from '../../../../shared/units/error-handler';
+import {State, SystemCVEAllowlist} from '../../../../shared/services';
+import {ConfirmationState, ConfirmationTargets} from '../../../../shared/entities/shared.const';
+import {ConfirmationMessage} from '../../../global-confirmation-dialog/confirmation-message';
+import {ConfirmationDialogComponent} from '../../../../shared/components/confirmation-dialog';
+import {ConfirmationAcknowledgement} from '../../../global-confirmation-dialog/confirmation-state-message';
import {TranslateService} from '@ngx-translate/core';
-
import {Project} from './project';
-import {SystemInfo, SystemInfoService} from '../../services';
-import {UserPermissionService} from '../../services/permission.service';
-import {USERSTATICPERMISSION} from '../../services/permission-static';
+import {SystemInfo, SystemInfoService} from '../../../../shared/services';
+import {UserPermissionService} from '../../../../shared/services';
+import {USERSTATICPERMISSION} from '../../../../shared/services';
const ONE_THOUSAND: number = 1000;
@@ -38,13 +35,13 @@ export class ProjectPolicy {
}
initByProject(pro: Project) {
- this.Public = pro.metadata.public === 'true' ? true : false;
- this.ContentTrust = pro.metadata.enable_content_trust === 'true' ? true : false;
- this.PreventVulImg = pro.metadata.prevent_vul === 'true' ? true : false;
+ this.Public = pro.metadata.public === 'true';
+ this.ContentTrust = pro.metadata.enable_content_trust === 'true';
+ this.PreventVulImg = pro.metadata.prevent_vul === 'true';
if (pro.metadata.severity) {
this.PreventVulImgSeverity = pro.metadata.severity;
}
- this.ScanImgOnPush = pro.metadata.auto_scan === 'true' ? true : false;
+ this.ScanImgOnPush = pro.metadata.auto_scan === 'true';
}
}
diff --git a/src/portal/src/lib/components/project-policy-config/project.ts b/src/portal/src/app/base/project/project-config/project-policy-config/project.ts
similarity index 100%
rename from src/portal/src/lib/components/project-policy-config/project.ts
rename to src/portal/src/app/base/project/project-config/project-policy-config/project.ts
diff --git a/src/portal/src/app/project/project-detail/project-detail.component.html b/src/portal/src/app/base/project/project-detail/project-detail.component.html
similarity index 100%
rename from src/portal/src/app/project/project-detail/project-detail.component.html
rename to src/portal/src/app/base/project/project-detail/project-detail.component.html
diff --git a/src/portal/src/app/project/project-detail/project-detail.component.scss b/src/portal/src/app/base/project/project-detail/project-detail.component.scss
similarity index 100%
rename from src/portal/src/app/project/project-detail/project-detail.component.scss
rename to src/portal/src/app/base/project/project-detail/project-detail.component.scss
diff --git a/src/portal/src/app/project/project-detail/project-detail.component.spec.ts b/src/portal/src/app/base/project/project-detail/project-detail.component.spec.ts
similarity index 93%
rename from src/portal/src/app/project/project-detail/project-detail.component.spec.ts
rename to src/portal/src/app/base/project/project-detail/project-detail.component.spec.ts
index 21130b4401..b685baef08 100644
--- a/src/portal/src/app/project/project-detail/project-detail.component.spec.ts
+++ b/src/portal/src/app/base/project/project-detail/project-detail.component.spec.ts
@@ -9,10 +9,10 @@ import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { of } from 'rxjs';
import { ActivatedRoute } from '@angular/router';
-import { SessionService } from '../../shared/session.service';
-import { AppConfigService } from "../../services/app-config.service";
-import { ProjectService, UserPermissionService } from "../../../lib/services";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
+import { SessionService } from '../../../shared/services/session.service';
+import { AppConfigService } from "../../../services/app-config.service";
+import { ProjectService, UserPermissionService } from "../../../shared/services";
+import { ErrorHandler } from "../../../shared/units/error-handler";
describe('ProjectDetailComponent', () => {
let component: ProjectDetailComponent;
diff --git a/src/portal/src/app/project/project-detail/project-detail.component.ts b/src/portal/src/app/base/project/project-detail/project-detail.component.ts
similarity index 97%
rename from src/portal/src/app/project/project-detail/project-detail.component.ts
rename to src/portal/src/app/base/project/project-detail/project-detail.component.ts
index 8df30d4ce8..ba50c76382 100644
--- a/src/portal/src/app/project/project-detail/project-detail.component.ts
+++ b/src/portal/src/app/base/project/project-detail/project-detail.component.ts
@@ -14,11 +14,11 @@
import { Component, OnInit, HostListener, AfterViewInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Project } from '../project';
-import { SessionService } from '../../shared/session.service';
-import { AppConfigService } from "../../services/app-config.service";
+import { SessionService } from '../../../shared/services/session.service';
+import { AppConfigService } from "../../../services/app-config.service";
import { forkJoin, Subject, Subscription } from "rxjs";
-import { UserPermissionService, USERSTATICPERMISSION } from "../../../lib/services";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
+import { UserPermissionService, USERSTATICPERMISSION } from "../../../shared/services";
+import { ErrorHandler } from "../../../shared/units/error-handler";
import { debounceTime } from 'rxjs/operators';
import { DOWN, SHOW_ELLIPSIS_WIDTH, UP } from './project-detail.const';
diff --git a/src/portal/src/app/project/project-detail/project-detail.const.ts b/src/portal/src/app/base/project/project-detail/project-detail.const.ts
similarity index 100%
rename from src/portal/src/app/project/project-detail/project-detail.const.ts
rename to src/portal/src/app/base/project/project-detail/project-detail.const.ts
diff --git a/src/portal/src/app/project/project-label/project-label.component.html b/src/portal/src/app/base/project/project-label/project-label.component.html
similarity index 100%
rename from src/portal/src/app/project/project-label/project-label.component.html
rename to src/portal/src/app/base/project/project-label/project-label.component.html
diff --git a/src/portal/src/app/project/project-label/project-label.component.scss b/src/portal/src/app/base/project/project-label/project-label.component.scss
similarity index 100%
rename from src/portal/src/app/project/project-label/project-label.component.scss
rename to src/portal/src/app/base/project/project-label/project-label.component.scss
diff --git a/src/portal/src/app/project/project-label/project-label.component.spec.ts b/src/portal/src/app/base/project/project-label/project-label.component.spec.ts
similarity index 79%
rename from src/portal/src/app/project/project-label/project-label.component.spec.ts
rename to src/portal/src/app/base/project/project-label/project-label.component.spec.ts
index 835084690a..dcc722ca17 100644
--- a/src/portal/src/app/project/project-label/project-label.component.spec.ts
+++ b/src/portal/src/app/base/project/project-label/project-label.component.spec.ts
@@ -3,9 +3,9 @@ import { Router, ActivatedRoute } from '@angular/router';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { of } from 'rxjs';
import { ProjectLabelComponent } from './project-label.component';
-import { SessionService } from '../../shared/session.service';
-import { ErrorHandler } from "../../../lib/utils/error-handler";
-import { UserPermissionService } from "../../../lib/services";
+import { SessionService } from '../../../shared/services/session.service';
+import { UserPermissionService } from "../../../shared/services";
+import { SharedTestingModule } from "../../../shared/shared.module";
describe('ProjectLabelComponent', () => {
let component: ProjectLabelComponent;
@@ -28,15 +28,19 @@ describe('ProjectLabelComponent', () => {
schemas: [
CUSTOM_ELEMENTS_SCHEMA
],
+ imports: [
+ SharedTestingModule
+ ],
providers: [
- ErrorHandler,
{ provide: Router, useValue: fakeRouter },
{
provide: ActivatedRoute, useValue: {
snapshot: {
parent: {
- params: {
- id: 1
+ parent: {
+ params: {
+ id: 1
+ }
}
}
}
diff --git a/src/portal/src/app/project/project-label/project-label.component.ts b/src/portal/src/app/base/project/project-label/project-label.component.ts
similarity index 89%
rename from src/portal/src/app/project/project-label/project-label.component.ts
rename to src/portal/src/app/base/project/project-label/project-label.component.ts
index 709e8d95fd..876ffa1cd0 100644
--- a/src/portal/src/app/project/project-label/project-label.component.ts
+++ b/src/portal/src/app/base/project/project-label/project-label.component.ts
@@ -13,11 +13,11 @@
// limitations under the License.
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
-import { SessionService } from '../../shared/session.service';
-import { SessionUser } from '../../shared/session-user';
+import { SessionService } from '../../../shared/services/session.service';
+import { SessionUser } from '../../../shared/entities/session-user';
import { forkJoin } from 'rxjs';
-import { UserPermissionService, USERSTATICPERMISSION } from "../../../lib/services";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
+import { UserPermissionService, USERSTATICPERMISSION } from "../../../shared/services";
+import { ErrorHandler } from "../../../shared/units/error-handler";
@Component({
selector: 'app-project-config',
@@ -42,7 +42,7 @@ export class ProjectLabelComponent implements OnInit {
private session: SessionService) {}
ngOnInit() {
- this.projectId = +this.route.snapshot.parent.params['id'];
+ this.projectId = +this.route.snapshot.parent.parent.params['id'];
this.currentUser = this.session.getCurrentUser();
this.hasSignedIn = this.session.getCurrentUser() !== null;
this.getLabelPermissionRule(this.projectId);
diff --git a/src/portal/src/app/base/project/project-label/project-label.module.ts b/src/portal/src/app/base/project/project-label/project-label.module.ts
new file mode 100644
index 0000000000..4af88593ea
--- /dev/null
+++ b/src/portal/src/app/base/project/project-label/project-label.module.ts
@@ -0,0 +1,19 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { ProjectLabelComponent } from "./project-label.component";
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ProjectLabelComponent
+ }
+];
+@NgModule({
+ declarations: [ProjectLabelComponent],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ]
+})
+export class ProjectLabelModule { }
diff --git a/src/portal/src/app/log/audit-log.component.html b/src/portal/src/app/base/project/project-log/audit-log.component.html
similarity index 100%
rename from src/portal/src/app/log/audit-log.component.html
rename to src/portal/src/app/base/project/project-log/audit-log.component.html
diff --git a/src/portal/src/app/log/audit-log.component.scss b/src/portal/src/app/base/project/project-log/audit-log.component.scss
similarity index 100%
rename from src/portal/src/app/log/audit-log.component.scss
rename to src/portal/src/app/base/project/project-log/audit-log.component.scss
diff --git a/src/portal/src/app/log/audit-log.component.spec.ts b/src/portal/src/app/base/project/project-log/audit-log.component.spec.ts
similarity index 83%
rename from src/portal/src/app/log/audit-log.component.spec.ts
rename to src/portal/src/app/base/project/project-log/audit-log.component.spec.ts
index 465802a6fd..2a8dd527c6 100644
--- a/src/portal/src/app/log/audit-log.component.spec.ts
+++ b/src/portal/src/app/base/project/project-log/audit-log.component.spec.ts
@@ -1,20 +1,15 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { AuditLogComponent } from './audit-log.component';
-import { ClarityModule } from '@clr/angular';
-import { MessageHandlerService } from '../shared/message-handler/message-handler.service';
+import { MessageHandlerService } from '../../../shared/services/message-handler.service';
import { ActivatedRoute, Router } from '@angular/router';
import { of } from 'rxjs';
import { CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core';
-import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
-import { RouterTestingModule } from '@angular/router/testing';
import { delay } from 'rxjs/operators';
-import { HarborLibraryModule } from "../../lib/harbor-library.module";
-import { AuditLog } from "../../../ng-swagger-gen/models/audit-log";
+import { AuditLog } from "../../../../../ng-swagger-gen/models/audit-log";
import { HttpHeaders, HttpResponse } from "@angular/common/http";
-import { ProjectService } from "../../../ng-swagger-gen/services/project.service";
-import { click } from "../../lib/utils/utils";
-import { FormsModule } from "@angular/forms";
+import { ProjectService } from "../../../../../ng-swagger-gen/services/project.service";
+import { click } from "../../../shared/units/utils";
+import { SharedTestingModule } from "../../../shared/shared.module";
describe('AuditLogComponent', () => {
let component: AuditLogComponent;
@@ -24,8 +19,10 @@ describe('AuditLogComponent', () => {
};
const mockActivatedRoute = {
parent: {
- snapshot: {
- data: null
+ parent: {
+ snapshot: {
+ data: null
+ }
}
},
snapshot: {
@@ -82,17 +79,10 @@ describe('AuditLogComponent', () => {
CUSTOM_ELEMENTS_SCHEMA
],
imports: [
- BrowserAnimationsModule,
- ClarityModule,
- TranslateModule.forRoot(),
- FormsModule,
- RouterTestingModule,
- NoopAnimationsModule,
- HarborLibraryModule
+ SharedTestingModule
],
declarations: [AuditLogComponent],
providers: [
- TranslateService,
{ provide: ActivatedRoute, useValue: mockActivatedRoute },
{ provide: Router, useValue: mockRouter },
{ provide: ProjectService, useValue: fakedAuditlogService },
diff --git a/src/portal/src/app/log/audit-log.component.ts b/src/portal/src/app/base/project/project-log/audit-log.component.ts
similarity index 92%
rename from src/portal/src/app/log/audit-log.component.ts
rename to src/portal/src/app/base/project/project-log/audit-log.component.ts
index 2567a21885..8a39e9becd 100644
--- a/src/portal/src/app/log/audit-log.component.ts
+++ b/src/portal/src/app/base/project/project-log/audit-log.component.ts
@@ -13,13 +13,13 @@
// limitations under the License.
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
-import { SessionUser } from '../shared/session-user';
-import { MessageHandlerService } from '../shared/message-handler/message-handler.service';
-import { ProjectService } from "../../../ng-swagger-gen/services/project.service";
-import { AuditLog } from "../../../ng-swagger-gen/models/audit-log";
-import { Project } from "../project/project";
+import { SessionUser } from '../../../shared/entities/session-user';
+import { MessageHandlerService } from '../../../shared/services/message-handler.service';
+import { ProjectService } from "../../../../../ng-swagger-gen/services/project.service";
+import { AuditLog } from "../../../../../ng-swagger-gen/models/audit-log";
+import { Project } from "../project";
import { finalize } from "rxjs/operators";
-import {DEFAULT_PAGE_SIZE} from "../../lib/utils/utils";
+import {DEFAULT_PAGE_SIZE} from "../../../shared/units/utils";
import {ClrDatagridStateInterface} from "@clr/angular";
const optionalSearch: {} = { 0: 'AUDIT_LOG.ADVANCED', 1: 'AUDIT_LOG.SIMPLE' };
@@ -93,7 +93,7 @@ export class AuditLogComponent implements OnInit {
}
ngOnInit(): void {
- const resolverData = this.route.parent.snapshot.data;
+ const resolverData = this.route.parent.parent.snapshot.data;
if (resolverData) {
const pro: Project = resolverData['projectResolver'];
this.projectName = pro.name;
diff --git a/src/portal/src/app/base/project/project-log/audit-log.module.ts b/src/portal/src/app/base/project/project-log/audit-log.module.ts
new file mode 100644
index 0000000000..618018a2cd
--- /dev/null
+++ b/src/portal/src/app/base/project/project-log/audit-log.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { AuditLogComponent } from "./audit-log.component";
+
+
+const routes: Routes = [
+ {
+ path: '',
+ component: AuditLogComponent
+ }
+];
+@NgModule({
+ declarations: [AuditLogComponent],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ]
+})
+export class AuditLogModule { }
diff --git a/src/portal/src/app/base/project/project.module.ts b/src/portal/src/app/base/project/project.module.ts
new file mode 100644
index 0000000000..e50eb01c86
--- /dev/null
+++ b/src/portal/src/app/base/project/project.module.ts
@@ -0,0 +1,177 @@
+// Copyright Project Harbor Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { SharedModule } from '../../shared/shared.module';
+import { ProjectDetailComponent } from './project-detail/project-detail.component';
+import { MemberPermissionGuard } from "../../shared/router-guard/member-permission-guard-activate.service";
+import { USERSTATICPERMISSION } from "../../shared/services";
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ProjectDetailComponent,
+ children: [
+ {
+ path: 'summary',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.PROJECT.KEY,
+ action: USERSTATICPERMISSION.PROJECT.VALUE.READ
+ }
+ },
+ loadChildren: () => import('./summary/summary.module').then(m => m.SummaryModule),
+ },
+ {
+ path: 'repositories',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.REPOSITORY.KEY,
+ action: USERSTATICPERMISSION.REPOSITORY.VALUE.LIST
+ }
+ },
+ loadChildren: () => import('./repository/repository.module').then(m => m.RepositoryModule),
+ },
+ {
+ path: 'helm-charts',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.HELM_CHART.KEY,
+ action: USERSTATICPERMISSION.HELM_CHART.VALUE.LIST
+ }
+ },
+ loadChildren: () => import('./helm-chart/helm-chart-list/helm-chart-list.module').then(m => m.HelmChartListModule),
+ },
+ {
+ path: 'members',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.MEMBER.KEY,
+ action: USERSTATICPERMISSION.MEMBER.VALUE.LIST
+ }
+ },
+ loadChildren: () => import('./member/member.module').then(m => m.MemberModule),
+ },
+ {
+ path: 'logs',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.LOG.KEY,
+ action: USERSTATICPERMISSION.LOG.VALUE.LIST
+ }
+ },
+ loadChildren: () => import('./project-log/audit-log.module').then(m => m.AuditLogModule),
+ },
+ {
+ path: 'labels',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.LABEL.KEY,
+ action: USERSTATICPERMISSION.LABEL.VALUE.CREATE
+ }
+ },
+ loadChildren: () => import('./project-label/project-label.module').then(m => m.ProjectLabelModule),
+ },
+ {
+ path: 'configs',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.CONFIGURATION.KEY,
+ action: USERSTATICPERMISSION.CONFIGURATION.VALUE.READ
+ }
+ },
+ loadChildren: () => import('./project-config/project-config.module').then(m => m.ProjectConfigModule),
+ },
+ {
+ path: 'robot-account',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.ROBOT.KEY,
+ action: USERSTATICPERMISSION.ROBOT.VALUE.LIST
+ }
+ },
+ loadChildren: () => import('./robot-account/project-robot-account.module').then(m => m.ProjectRobotAccountModule),
+ },
+ {
+ path: 'tag-strategy',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.TAG_RETENTION.KEY,
+ action: USERSTATICPERMISSION.TAG_RETENTION.VALUE.READ
+ }
+ },
+ loadChildren: () => import('./tag-feature-integration/tag-feature-integration.module').then(m => m.TagFeatureIntegrationModule),
+ },
+ {
+ path: 'webhook',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.WEBHOOK.KEY,
+ action: USERSTATICPERMISSION.WEBHOOK.VALUE.LIST
+ }
+ },
+ loadChildren: () => import('./webhook/webhook.module').then(m => m.WebhookModule),
+ },
+ {
+ path: 'scanner',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.SCANNER.KEY,
+ action: USERSTATICPERMISSION.SCANNER.VALUE.READ
+ }
+ },
+ loadChildren: () => import('./scanner/project-scanner.module').then(m => m.ProjectScannerModule),
+ },
+ {
+ path: 'p2p-provider',
+ canActivate: [MemberPermissionGuard],
+ data: {
+ permissionParam: {
+ resource: USERSTATICPERMISSION.P2P_PROVIDER.KEY,
+ action: USERSTATICPERMISSION.P2P_PROVIDER.VALUE.READ
+ }
+ },
+ loadChildren: () => import('./p2p-provider/p2p-provider.module').then(m => m.P2pProviderModule),
+ },
+ {
+ path: '',
+ redirectTo: 'repositories',
+ pathMatch: 'full'
+ },
+ ]
+ }
+];
+@NgModule({
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule,
+ ],
+ declarations: [
+ ProjectDetailComponent,
+ ]
+})
+export class ProjectModule {
+
+}
diff --git a/src/portal/src/app/project/project.ts b/src/portal/src/app/base/project/project.ts
similarity index 100%
rename from src/portal/src/app/project/project.ts
rename to src/portal/src/app/base/project/project.ts
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/additions.service.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/additions.service.spec.ts
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/additions.service.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/additions.service.spec.ts
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/additions.service.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/additions.service.ts
similarity index 88%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/additions.service.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/additions.service.ts
index 8599febf8f..9d187496ab 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/additions.service.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/additions.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Observable } from "rxjs";
-import { DEFAULT_SUPPORTED_MIME_TYPES } from "../../../../../lib/utils/utils";
+import { DEFAULT_SUPPORTED_MIME_TYPES } from "../../../../../shared/units/utils";
@Injectable({
providedIn: 'root',
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.spec.ts
similarity index 69%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.spec.ts
index ff9d913a97..f319adba54 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.spec.ts
@@ -1,9 +1,9 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { ArtifactAdditionsComponent } from './artifact-additions.component';
-import { AdditionLinks } from "../../../../../../ng-swagger-gen/models/addition-links";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../../lib/entities/service.config";
-import { ProjectModule } from "../../../project.module";
-import { CURRENT_BASE_HREF } from "../../../../../lib/utils/utils";
+import { AdditionLinks } from "../../../../../../../ng-swagger-gen/models/addition-links";
+import { CURRENT_BASE_HREF } from "../../../../../shared/units/utils";
+import { SharedTestingModule } from "../../../../../shared/shared.module";
+import { NO_ERRORS_SCHEMA } from "@angular/core";
describe('ArtifactAdditionsComponent', () => {
@@ -13,20 +13,20 @@ describe('ArtifactAdditionsComponent', () => {
href: CURRENT_BASE_HREF + "/test"
}
};
- const config: IServiceConfig = {
- baseEndpoint: CURRENT_BASE_HREF
- };
let component: ArtifactAdditionsComponent;
let fixture: ComponentFixture;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- ProjectModule
+ SharedTestingModule
+ ],
+ declarations: [
+ ArtifactAdditionsComponent
+ ],
+ schemas: [
+ NO_ERRORS_SCHEMA
],
- providers: [
- { provide: SERVICE_CONFIG, useValue: config },
- ]
})
.compileComponents();
}));
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.ts
similarity index 85%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.ts
index 253c2f038e..8f920350f0 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.ts
@@ -1,8 +1,8 @@
import { Component, OnInit, Input } from '@angular/core';
import { ADDITIONS } from "./models";
-import { AdditionLinks } from "../../../../../../ng-swagger-gen/models/addition-links";
-import { AdditionLink } from "../../../../../../ng-swagger-gen/models/addition-link";
-import { Artifact } from "../../../../../../ng-swagger-gen/models/artifact";
+import { AdditionLinks } from "../../../../../../../ng-swagger-gen/models/addition-links";
+import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
+import { Artifact } from "../../../../../../../ng-swagger-gen/models/artifact";
@Component({
selector: 'artifact-additions',
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.spec.ts
similarity index 90%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.spec.ts
index 7b42fe05a6..f7eb52cee1 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.spec.ts
@@ -12,12 +12,12 @@ import {
SystemInfoService,
UserPermissionService,
VulnerabilityItem
-} from "../../../../../../lib/services";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
-import { ChannelService } from "../../../../../../lib/services/channel.service";
-import {SessionService} from "../../../../../shared/session.service";
-import {SessionUser} from "../../../../../shared/session-user";
+} from "../../../../../../shared/services";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
+import { ChannelService } from "../../../../../../shared/services/channel.service";
+import {SessionService} from "../../../../../../shared/services/session.service";
+import {SessionUser} from "../../../../../../shared/entities/session-user";
import {delay} from "rxjs/operators";
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts
similarity index 93%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts
index 18e51be081..4c79424efa 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { AdditionsService } from "../additions.service";
import { ClrDatagridComparatorInterface, ClrLoadingState } from "@clr/angular";
import { finalize } from "rxjs/operators";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
import {
ProjectService,
ScannerVo,
@@ -10,17 +10,17 @@ import {
UserPermissionService,
USERSTATICPERMISSION,
VulnerabilityItem
-} from "../../../../../../lib/services";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
+} from "../../../../../../shared/services";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
import {
SEVERITY_LEVEL_MAP,
VULNERABILITY_SEVERITY
-} from "../../../../../../lib/utils/utils";
-import { ChannelService } from "../../../../../../lib/services/channel.service";
-import { ResultBarChartComponent } from "../../../vulnerability-scanning/result-bar-chart.component";
+} from "../../../../../../shared/units/utils";
+import { ChannelService } from "../../../../../../shared/services/channel.service";
+import { ResultBarChartComponent } from "../../vulnerability-scanning/result-bar-chart.component";
import { Subscription } from "rxjs";
-import { Artifact } from "../../../../../../../ng-swagger-gen/models/artifact";
-import {SessionService} from "../../../../../shared/session.service";
+import { Artifact } from "../../../../../../../../ng-swagger-gen/models/artifact";
+import {SessionService} from "../../../../../../shared/services/session.service";
@Component({
selector: 'hbr-artifact-vulnerabilities',
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.spec.ts
similarity index 92%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.spec.ts
index 9687b717e1..a242f9c6a1 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.spec.ts
@@ -7,8 +7,8 @@ import { TranslateFakeLoader, TranslateLoader, TranslateModule } from "@ngx-tran
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { BuildHistoryComponent } from "./build-history.component";
import { ArtifactBuildHistory } from "../models";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
describe('BuildHistoryComponent', () => {
let component: BuildHistoryComponent;
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.ts
similarity index 91%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.ts
index 0ae0e76cef..bc7a3c3387 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/build-history/build-history.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.ts
@@ -2,8 +2,8 @@ import { Component, Input, OnInit } from "@angular/core";
import { AdditionsService } from "../additions.service";
import { ArtifactBuildHistory } from "../models";
import { finalize } from "rxjs/operators";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
@Component({
selector: "hbr-artifact-build-history",
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.spec.ts
similarity index 81%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.spec.ts
index f1a1097684..0e5a1fd5b0 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.spec.ts
@@ -4,11 +4,10 @@ import { DependenciesComponent } from "./dependencies.component";
import { AdditionsService } from '../additions.service';
import { of } from 'rxjs';
import { ArtifactDependency } from "../models";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../../../lib/entities/service.config";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
import { ClarityModule } from "@clr/angular";
-import { CURRENT_BASE_HREF } from "../../../../../../lib/utils/utils";
+import { CURRENT_BASE_HREF } from "../../../../../../shared/units/utils";
describe('DependenciesComponent', () => {
@@ -36,9 +35,6 @@ describe('DependenciesComponent', () => {
absolute: false,
href: '/test'
};
- const config: IServiceConfig = {
- repositoryBaseEndpoint: CURRENT_BASE_HREF + "/repositories/testing"
- };
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
@@ -48,8 +44,6 @@ describe('DependenciesComponent', () => {
declarations: [DependenciesComponent],
providers: [
TranslateService,
- { provide: SERVICE_CONFIG, useValue: config },
-
{
provide: ErrorHandler, useValue: mockErrorHandler
},
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.ts
similarity index 86%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.ts
index 4b969c6a93..a1b737f326 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/dependencies/dependencies.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/dependencies/dependencies.component.ts
@@ -5,9 +5,8 @@ import {
} from "@angular/core";
import { ArtifactDependency } from "../models";
import { AdditionsService } from "../additions.service";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
-import { pipe } from "rxjs";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
import { finalize } from "rxjs/operators";
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/models.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/models.ts
similarity index 95%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/models.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/models.ts
index ff9bfb8db9..bd788d1263 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/models.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/models.ts
@@ -1,4 +1,4 @@
-import { HelmChartMaintainer } from "../../../helm-chart/helm-chart.interface.service";
+import { HelmChartMaintainer } from "../../../helm-chart/helm-chart-detail/helm-chart.interface.service";
export class ArtifactBuildHistory {
created: Date;
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.spec.ts
similarity index 96%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.spec.ts
index 056937f716..835f5c407c 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.spec.ts
@@ -3,11 +3,9 @@ import { NO_ERRORS_SCHEMA } from "@angular/core";
import { AdditionsService } from "../additions.service";
import { of } from "rxjs";
import { SummaryComponent } from "./summary.component";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../../../lib/entities/service.config";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
-import { ProjectModule } from "../../../../project.module";
-import { CURRENT_BASE_HREF } from "../../../../../../lib/utils/utils";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
+import { SharedTestingModule } from "../../../../../../shared/shared.module";
describe('SummaryComponent', () => {
let component: SummaryComponent;
@@ -160,18 +158,17 @@ describe('SummaryComponent', () => {
return of(readme);
}
};
- const config: IServiceConfig = {
- repositoryBaseEndpoint: CURRENT_BASE_HREF + "/repositories/testing"
- };
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- ProjectModule
+ SharedTestingModule
+ ],
+ declarations: [
+ SummaryComponent
],
providers: [
ErrorHandler,
{ provide: AdditionsService, useValue: fakedAdditionsService },
- { provide: SERVICE_CONFIG, useValue: config },
],
schemas: [
NO_ERRORS_SCHEMA
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.ts
similarity index 85%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.ts
index f87eaa7d55..e5caf6099a 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/summary/summary.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/summary/summary.component.ts
@@ -4,8 +4,8 @@ import {
Input
} from "@angular/core";
import { AdditionsService } from "../additions.service";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
import { finalize } from "rxjs/operators";
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.spec.ts
similarity index 92%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.spec.ts
index f99f88941b..815eb123e9 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.spec.ts
@@ -8,8 +8,8 @@ import { BrowserModule } from '@angular/platform-browser';
import { ValuesComponent } from "./values.component";
import { AdditionsService } from "../additions.service";
import { of } from "rxjs";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
describe('ValuesComponent', () => {
diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.ts
similarity index 90%
rename from src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.ts
index 1e4d172a94..e51c9007da 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-additions/values/values.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/values/values.component.ts
@@ -4,11 +4,11 @@ import {
OnInit,
} from "@angular/core";
import { AdditionsService } from "../additions.service";
-import { AdditionLink } from "../../../../../../../ng-swagger-gen/models/addition-link";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
+import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
import * as yaml from "js-yaml";
import { finalize } from "rxjs/operators";
-import { isObject } from "../../../../../../lib/utils/utils";
+import { isObject } from "../../../../../../shared/units/utils";
@Component({
selector: "hbr-artifact-values",
diff --git a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.spec.ts
similarity index 95%
rename from src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.spec.ts
index 2edbc7deb0..ab903c3a84 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.spec.ts
@@ -4,7 +4,7 @@ import { ArtifactCommonPropertiesComponent } from './artifact-common-properties.
import { ClarityModule } from "@clr/angular";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { TranslateFakeLoader, TranslateLoader, TranslateModule, TranslateService } from "@ngx-translate/core";
-import { ExtraAttrs } from "../../../../../../ng-swagger-gen/models/extra-attrs";
+import { ExtraAttrs } from "../../../../../../../ng-swagger-gen/models/extra-attrs";
describe('ArtifactCommonPropertiesComponent', () => {
let component: ArtifactCommonPropertiesComponent;
diff --git a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts
similarity index 90%
rename from src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts
index c0d3fe67b1..03132ade76 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts
@@ -1,8 +1,6 @@
import { Component, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core';
import { DatePipe } from "@angular/common";
-import { TranslateService } from "@ngx-translate/core";
-import { Artifact } from "../../../../../../ng-swagger-gen/models/artifact";
-import { isObject } from "../../../../../lib/utils/utils";
+import { Artifact } from "../../../../../../../ng-swagger-gen/models/artifact";
enum Types {
CREATED = 'created',
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.html
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.scss
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.spec.ts
similarity index 83%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.spec.ts
index fecfb9f6b7..a3cc4f4681 100644
--- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.spec.ts
@@ -8,12 +8,11 @@ import { FormsModule } from '@angular/forms';
import { of } from 'rxjs';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ActivatedRoute, Router } from '@angular/router';
-import { SessionService } from "../../../shared/session.service";
-import { AppConfigService } from "../../../services/app-config.service";
-import { ArtifactService } from "../../../../../ng-swagger-gen/services/artifact.service";
-import { ArtifactDefaultService } from "../artifact/artifact.service";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../lib/entities/service.config";
-import { CURRENT_BASE_HREF } from "../../../../lib/utils/utils";
+import { SessionService } from "../../../../../shared/services/session.service";
+import { AppConfigService } from "../../../../../services/app-config.service";
+import { ArtifactService } from "../../../../../../../ng-swagger-gen/services/artifact.service";
+import { ArtifactDefaultService } from "../artifact.service";
+import { CURRENT_BASE_HREF } from "../../../../../shared/units/utils";
describe('ArtifactListPageComponent', () => {
let component: ArtifactListPageComponent;
@@ -70,9 +69,6 @@ describe('ArtifactListPageComponent', () => {
}
}
};
- const config: IServiceConfig = {
- repositoryBaseEndpoint: CURRENT_BASE_HREF + "/repositories/testing"
- };
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
schemas: [
@@ -90,7 +86,6 @@ describe('ArtifactListPageComponent', () => {
providers: [
TranslateService,
ArtifactDefaultService,
- { provide: SERVICE_CONFIG, useValue: config },
{ provide: SessionService, useValue: mockSessionService },
{ provide: AppConfigService, useValue: mockAppConfigService },
{ provide: Router, useValue: mockRouter },
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.ts
similarity index 86%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.ts
index 69ab5e54e6..314cf01ba7 100644
--- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list-page.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list-page.component.ts
@@ -14,11 +14,11 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ArtifactListComponent } from "./artifact-list/artifact-list.component";
-import { ArtifactDefaultService } from "../artifact/artifact.service";
-import { AppConfigService } from "../../../services/app-config.service";
-import { SessionService } from "../../../shared/session.service";
-import { ArtifactClickEvent } from "../../../../lib/services";
-import { Project } from "../../project";
+import { ArtifactDefaultService } from "../artifact.service";
+import { AppConfigService } from "../../../../../services/app-config.service";
+import { SessionService } from "../../../../../shared/services/session.service";
+import { ArtifactClickEvent } from "../../../../../shared/services";
+import { Project } from "../../../project";
@Component({
selector: 'artifact-list-page',
@@ -55,11 +55,8 @@ export class ArtifactListPageComponent implements OnInit {
}
ngOnInit() {
- this.projectId = this.route.snapshot.params['id'];
- if (!this.projectId) {
- this.projectId = this.route.snapshot.parent.params['id'];
- }
- let resolverData = this.route.snapshot.data;
+ this.projectId = this.route.snapshot.parent.params['id'];
+ let resolverData = this.route.snapshot.parent.data;
if (resolverData) {
this.projectName = (resolverData['projectResolver']).name;
this.hasProjectAdminRole = (resolverData['projectResolver']).has_project_admin_role;
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html
similarity index 99%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html
index 3bd76827c1..00736937dc 100644
--- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html
@@ -257,7 +257,7 @@
{{'ARTIFACT.SCAN_UNSUPPORTED' | translate}}
-
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts
similarity index 89%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts
index f6e0443c21..aa4494f3e9 100644
--- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts
@@ -7,7 +7,7 @@ import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { HttpClient, HttpHeaders, HttpResponse } from "@angular/common/http";
import { ActivatedRoute, Router } from "@angular/router";
-import { ArtifactDefaultService, ArtifactService } from "../../../artifact/artifact.service";
+import { ArtifactDefaultService, ArtifactService } from "../../../artifact.service";
import {
Label,
LabelDefaultService,
@@ -19,20 +19,18 @@ import {
UserPermissionDefaultService,
UserPermissionService,
USERSTATICPERMISSION
-} from "../../../../../../lib/services";
-import { ArtifactFront as Artifact } from "../../../artifact/artifact";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../../../lib/entities/service.config";
-import { SharedModule } from "../../../../../../lib/utils/shared/shared.module";
-import { LabelPieceComponent } from "../../../../../../lib/components/label-piece/label-piece.component";
-import { ConfirmationDialogComponent } from "../../../../../../lib/components/confirmation-dialog";
-import { ImageNameInputComponent } from "../../../../../../lib/components/image-name-input/image-name-input.component";
-import { CopyInputComponent } from "../../../../../../lib/components/push-image/copy-input.component";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
-import { ChannelService } from "../../../../../../lib/services/channel.service";
-import { OperationService } from "../../../../../../lib/components/operation/operation.service";
-import { ArtifactService as NewArtifactService } from "../../../../../../../ng-swagger-gen/services/artifact.service";
-import { AllPipesModule } from "../../../../../all-pipes/all-pipes.module";
-import { Tag } from "../../../../../../../ng-swagger-gen/models/tag";
+} from "../../../../../../../shared/services";
+import { ArtifactFront as Artifact } from "../../../artifact";
+import { LabelPieceComponent } from "../../../../../../../shared/components/label/label-piece/label-piece.component";
+import { ConfirmationDialogComponent } from "../../../../../../../shared/components/confirmation-dialog";
+import { ImageNameInputComponent } from "../../../../../../../shared/components/image-name-input/image-name-input.component";
+import { CopyInputComponent } from "../../../../../../../shared/components/push-image/copy-input.component";
+import { ErrorHandler } from "../../../../../../../shared/units/error-handler";
+import { ChannelService } from "../../../../../../../shared/services/channel.service";
+import { OperationService } from "../../../../../../../shared/components/operation/operation.service";
+import { ArtifactService as NewArtifactService } from "../../../../../../../../../ng-swagger-gen/services/artifact.service";
+import { Tag } from "../../../../../../../../../ng-swagger-gen/models/tag";
+import { SharedTestingModule } from "../../../../../../../shared/shared.module";
describe("ArtifactListTabComponent (inline template)", () => {
@@ -236,10 +234,6 @@ describe("ArtifactListTabComponent (inline template)", () => {
update_time: "",
}
];
-
- let config: IServiceConfig = {
- repositoryBaseEndpoint: "/api/repositories/testing"
- };
let mockHasAddLabelImagePermission: boolean = true;
let mockHasRetagImagePermission: boolean = true;
let mockHasDeleteImagePermission: boolean = true;
@@ -302,10 +296,9 @@ describe("ArtifactListTabComponent (inline template)", () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule,
+ SharedTestingModule,
BrowserAnimationsModule,
HttpClientTestingModule,
- AllPipesModule
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
@@ -322,7 +315,6 @@ describe("ArtifactListTabComponent (inline template)", () => {
ChannelService,
ArtifactDefaultService,
{ provide: Router, useValue: mockRouter },
- { provide: SERVICE_CONFIG, useValue: config },
{ provide: ArtifactService, useValue: mockNewArtifactService },
{ provide: ProjectService, useClass: ProjectDefaultService },
{ provide: ScanningResultService, useClass: ScanningResultDefaultService },
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts
similarity index 95%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts
index 177928ba47..cc4a267861 100644
--- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts
@@ -28,43 +28,41 @@ import { ActivatedRoute, Router } from "@angular/router";
import {
Comparator, Label, LabelService, ScannerVo, ScanningResultService,
UserPermissionService, USERSTATICPERMISSION, VulnerabilitySummary
-} from "../../../../../../lib/services";
+} from "../../../../../../../shared/services";
import {
calculatePage,
clone,
CustomComparator,
DEFAULT_PAGE_SIZE,
formatSize, VULNERABILITY_SCAN_STATUS, dbEncodeURIComponent, doSorting, DEFAULT_SUPPORTED_MIME_TYPES
-} from "../../../../../../lib/utils/utils";
-import {
- ConfirmationAcknowledgement,
- ConfirmationDialogComponent,
- ConfirmationMessage
-} from "../../../../../../lib/components/confirmation-dialog";
-import { ImageNameInputComponent } from "../../../../../../lib/components/image-name-input/image-name-input.component";
-import { CopyInputComponent } from "../../../../../../lib/components/push-image/copy-input.component";
-import { ErrorHandler } from "../../../../../../lib/utils/error-handler";
-import { ArtifactService } from "../../../artifact/artifact.service";
-import { OperationService } from "../../../../../../lib/components/operation/operation.service";
-import { ChannelService } from "../../../../../../lib/services/channel.service";
+} from "../../../../../../../shared/units/utils";
+import { ImageNameInputComponent } from "../../../../../../../shared/components/image-name-input/image-name-input.component";
+import { CopyInputComponent } from "../../../../../../../shared/components/push-image/copy-input.component";
+import { ErrorHandler } from "../../../../../../../shared/units/error-handler";
+import { ArtifactService } from "../../../artifact.service";
+import { OperationService } from "../../../../../../../shared/components/operation/operation.service";
+import { ChannelService } from "../../../../../../../shared/services/channel.service";
import {
ConfirmationButtons,
ConfirmationState,
ConfirmationTargets
-} from "../../../../../../lib/entities/shared.const";
-import { operateChanges, OperateInfo, OperationState } from "../../../../../../lib/components/operation/operate";
-import { errorHandler } from "../../../../../../lib/utils/shared/shared.utils";
+} from "../../../../../../../shared/entities/shared.const";
+import { operateChanges, OperateInfo, OperationState } from "../../../../../../../shared/components/operation/operate";
import {
ArtifactFront as Artifact,
mutipleFilter,
artifactPullCommands,
artifactDefault, ArtifactFront
-} from '../../../artifact/artifact';
-import { Project } from "../../../../project";
-import { ArtifactService as NewArtifactService } from "../../../../../../../ng-swagger-gen/services/artifact.service";
-import { ADDITIONS } from "../../../artifact/artifact-additions/models";
-import { Platform } from "../../../../../../../ng-swagger-gen/models/platform";
+} from '../../../artifact';
+import { Project } from "../../../../../project";
+import { ArtifactService as NewArtifactService } from "../../../../../../../../../ng-swagger-gen/services/artifact.service";
+import { ADDITIONS } from "../../../artifact-additions/models";
+import { Platform } from "../../../../../../../../../ng-swagger-gen/models/platform";
import { SafeUrl } from '@angular/platform-browser';
+import { errorHandler } from "../../../../../../../shared/units/shared.utils";
+import { ConfirmationDialogComponent } from "../../../../../../../shared/components/confirmation-dialog";
+import { ConfirmationMessage } from "../../../../../../global-confirmation-dialog/confirmation-message";
+import { ConfirmationAcknowledgement } from "../../../../../../global-confirmation-dialog/confirmation-state-message";
export interface LabelState {
iconsShow: boolean;
label: Label;
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.html
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.scss
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.spec.ts
similarity index 76%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.spec.ts
index def0034913..16799a5f38 100644
--- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.spec.ts
@@ -3,22 +3,19 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ArtifactListComponent } from './artifact-list.component';
import { of } from "rxjs";
import { delay } from 'rxjs/operators';
-import { ClarityModule } from '@clr/angular';
import { ActivatedRoute } from '@angular/router';
import {
SystemInfo, SystemInfoDefaultService,
SystemInfoService,
-} from "../../../../../lib/services";
-import { ArtifactDefaultService, ArtifactService } from "../../artifact/artifact.service";
-import { ChannelService } from "../../../../../lib/services/channel.service";
-
-import { TranslateFakeLoader, TranslateLoader, TranslateModule, TranslateService } from "@ngx-translate/core";
-import { ErrorHandler } from "../../../../../lib/utils/error-handler";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../../lib/entities/service.config";
-import { SharedModule } from "../../../../../lib/utils/shared/shared.module";
+} from "../../../../../../shared/services";
+import { ArtifactDefaultService, ArtifactService } from "../../artifact.service";
+import { ChannelService } from "../../../../../../shared/services/channel.service";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
import {
RepositoryService as NewRepositoryService
-} from "../../../../../../ng-swagger-gen/services/repository.service";
+} from "../../../../../../../../ng-swagger-gen/services/repository.service";
+import { SharedTestingModule } from "../../../../../../shared/shared.module";
+import { HttpClientTestingModule } from "@angular/common/http/testing";
describe('ArtifactListComponent (inline template)', () => {
@@ -66,20 +63,11 @@ describe('ArtifactListComponent (inline template)', () => {
const fakedErrorHandler = {
error: () => {}
};
- const config: IServiceConfig = {
- repositoryBaseEndpoint: "/api/repositories/testing"
- };
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- ClarityModule,
- SharedModule,
- TranslateModule.forRoot({
- loader: {
- provide: TranslateLoader,
- useClass: TranslateFakeLoader,
- }
- })
+ HttpClientTestingModule,
+ SharedTestingModule,
],
schemas: [
NO_ERRORS_SCHEMA
@@ -88,13 +76,11 @@ describe('ArtifactListComponent (inline template)', () => {
ArtifactListComponent
],
providers: [
- TranslateService,
{ provide: ErrorHandler, useValue: fakedErrorHandler },
{ provide: ChannelService, useValue: mockChannelService },
{ provide: SystemInfoService, useClass: SystemInfoDefaultService },
{ provide: ArtifactService, useClass: ArtifactDefaultService },
{ provide: ActivatedRoute, useValue: mockActivatedRoute },
- { provide: SERVICE_CONFIG, useValue: config },
{ provide: NewRepositoryService, useValue: newRepositoryService},
]
});
diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.ts
similarity index 89%
rename from src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.ts
index dcbd4905f2..c499bd8392 100644
--- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list.component.ts
@@ -13,21 +13,21 @@
// limitations under the License.
import { Component, OnInit, ViewChild, Input, Output, EventEmitter, OnDestroy } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
-import { ArtifactClickEvent, State, SystemInfo, SystemInfoService } from "../../../../../lib/services";
+import { ArtifactClickEvent, State, SystemInfo, SystemInfoService } from "../../../../../../shared/services";
import {
- ConfirmationAcknowledgement,
ConfirmationDialogComponent,
- ConfirmationMessage
-} from "../../../../../lib/components/confirmation-dialog";
-import { ErrorHandler } from "../../../../../lib/utils/error-handler";
-import { ArtifactService } from "../../artifact/artifact.service";
-import { ConfirmationState, ConfirmationTargets } from "../../../../../lib/entities/shared.const";
+} from "../../../../../../shared/components/confirmation-dialog";
+import { ErrorHandler } from "../../../../../../shared/units/error-handler";
+import { ArtifactService } from "../../artifact.service";
+import { ConfirmationState, ConfirmationTargets } from "../../../../../../shared/entities/shared.const";
import { ActivatedRoute } from "@angular/router";
-import { Project } from '../../../project';
+import { Project } from '../../../../project';
import {
RepositoryService as NewRepositoryService
-} from "../../../../../../ng-swagger-gen/services/repository.service";
-import { dbEncodeURIComponent } from '../../../../../lib/utils/utils';
+} from "../../../../../../../../ng-swagger-gen/services/repository.service";
+import { dbEncodeURIComponent } from '../../../../../../shared/units/utils';
+import { ConfirmationMessage } from "../../../../../global-confirmation-dialog/confirmation-message";
+import { ConfirmationAcknowledgement } from "../../../../../global-confirmation-dialog/confirmation-state-message";
const TabLinkContentMap: { [index: string]: string } = {
'repo-info': 'info',
'repo-image': 'image'
diff --git a/src/portal/src/app/project/repository/artifact/artifact-summary.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-summary.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-summary.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-summary.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-summary.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-summary.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-summary.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-summary.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-summary.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-summary.component.spec.ts
similarity index 75%
rename from src/portal/src/app/project/repository/artifact/artifact-summary.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-summary.component.spec.ts
index 9cf796ae51..dcfacc69f9 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-summary.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-summary.component.spec.ts
@@ -1,18 +1,14 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { ArtifactSummaryComponent } from "./artifact-summary.component";
import { of } from "rxjs";
-import { ClarityModule } from "@clr/angular";
import { NO_ERRORS_SCHEMA } from "@angular/core";
-import { Artifact } from "../../../../../ng-swagger-gen/models/artifact";
-import { ProjectService } from "../../../../lib/services";
-import { ArtifactService } from "../../../../../ng-swagger-gen/services/artifact.service";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
-import { TranslateFakeLoader, TranslateLoader, TranslateModule } from "@ngx-translate/core";
+import { Artifact } from "../../../../../../ng-swagger-gen/models/artifact";
+import { ProjectService } from "../../../../shared/services";
import { ActivatedRoute, Router } from "@angular/router";
-import { AppConfigService } from "../../../services/app-config.service";
+import { AppConfigService } from "../../../../services/app-config.service";
import { Project } from "../../project";
-import { AllPipesModule } from "../../../all-pipes/all-pipes.module";
import { ArtifactDefaultService } from './artifact.service';
+import { SharedTestingModule } from "../../../../shared/shared.module";
describe('ArtifactSummaryComponent', () => {
@@ -41,13 +37,17 @@ describe('ArtifactSummaryComponent', () => {
RouterparamMap: of({ get: (key) => 'value' }),
snapshot: {
params: {
- id: 1,
repo: "test",
digest: "ABC",
subscribe: () => {
return of(null);
}
},
+ parent: {
+ params: {
+ id: 1
+ }
+ },
data: {
artifactResolver: [mockedArtifact, new Project()]
}
@@ -70,14 +70,7 @@ describe('ArtifactSummaryComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- ClarityModule,
- AllPipesModule,
- TranslateModule.forRoot({
- loader: {
- provide: TranslateLoader,
- useClass: TranslateFakeLoader,
- }
- })
+ SharedTestingModule,
],
declarations: [
ArtifactSummaryComponent
@@ -91,7 +84,6 @@ describe('ArtifactSummaryComponent', () => {
{ provide: ActivatedRoute, useValue: mockActivatedRoute },
{ provide: ProjectService, useValue: fakedProjectService },
{ provide: ArtifactDefaultService, useValue: fakedArtifactDefaultService },
- ErrorHandler
]
})
.compileComponents();
diff --git a/src/portal/src/app/project/repository/artifact/artifact-summary.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-summary.component.ts
similarity index 88%
rename from src/portal/src/app/project/repository/artifact/artifact-summary.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-summary.component.ts
index 6213272aa2..9cac9e490b 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-summary.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-summary.component.ts
@@ -1,10 +1,10 @@
import { Component, Output, EventEmitter, OnInit } from "@angular/core";
-import { Artifact } from "../../../../../ng-swagger-gen/models/artifact";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
-import { Label } from "../../../../../ng-swagger-gen/models/label";
-import { ProjectService } from "../../../../lib/services";
+import { Artifact } from "../../../../../../ng-swagger-gen/models/artifact";
+import { ErrorHandler } from "../../../../shared/units/error-handler";
+import { Label } from "../../../../../../ng-swagger-gen/models/label";
+import { ProjectService } from "../../../../shared/services";
import { ActivatedRoute, Router } from "@angular/router";
-import { AppConfigService } from "../../../services/app-config.service";
+import { AppConfigService } from "../../../../services/app-config.service";
import { Project } from "../../project";
import { artifactDefault } from './artifact';
import { SafeUrl } from '@angular/platform-browser';
@@ -75,7 +75,7 @@ export class ArtifactSummaryComponent implements OnInit {
}
this.repositoryName = this.route.snapshot.params["repo"];
this.artifactDigest = this.route.snapshot.params["digest"];
- this.projectId = this.route.snapshot.params["id"];
+ this.projectId = this.route.snapshot.parent.params["id"];
if (this.repositoryName && this.artifactDigest) {
const resolverData = this.route.snapshot.data;
if (resolverData) {
diff --git a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html
rename to src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.html
diff --git a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.scss
rename to src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.scss
diff --git a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.spec.ts
similarity index 73%
rename from src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.spec.ts
index bc27eebcf8..2b13066f9c 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.spec.ts
@@ -4,15 +4,15 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { of } from 'rxjs';
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../../lib/entities/service.config";
-import { SharedModule } from "../../../../../lib/utils/shared/shared.module";
-import { ErrorHandler } from "../../../../../lib/utils/error-handler";
-import { ArtifactService } from '../../../../../../ng-swagger-gen/services/artifact.service';
-import { OperationService } from "../../../../../lib/components/operation/operation.service";
-import { CURRENT_BASE_HREF } from "../../../../../lib/utils/utils";
-import { USERSTATICPERMISSION, UserPermissionService, UserPermissionDefaultService, SystemInfoService } from '../../../../../lib/services';
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
+import { ArtifactService } from '../../../../../../../ng-swagger-gen/services/artifact.service';
+import { OperationService } from "../../../../../shared/components/operation/operation.service";
+import {
+ USERSTATICPERMISSION,
+ UserPermissionService, UserPermissionDefaultService, SystemInfoService } from '../../../../../shared/services';
import { delay } from 'rxjs/operators';
-import { AppConfigService } from "../../../../services/app-config.service";
+import { AppConfigService } from "../../../../../services/app-config.service";
+import { SharedTestingModule } from "../../../../../shared/shared.module";
describe('ArtifactTagComponent', () => {
let component: ArtifactTagComponent;
@@ -26,9 +26,6 @@ describe('ArtifactTagComponent', () => {
listTagsResponse: () => of([]).pipe(delay(0))
};
- const config: IServiceConfig = {
- repositoryBaseEndpoint: CURRENT_BASE_HREF + "/repositories/testing"
- };
const mockSystemInfoService = {
getSystemInfo: () => of( false )
};
@@ -53,7 +50,7 @@ describe('ArtifactTagComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule,
+ SharedTestingModule,
BrowserAnimationsModule,
HttpClientTestingModule
],
@@ -62,9 +59,7 @@ describe('ArtifactTagComponent', () => {
],
declarations: [ ArtifactTagComponent ],
providers: [
- ErrorHandler,
- { provide: SERVICE_CONFIG, useValue: config },
- { provide: mockErrorHandler, useValue: ErrorHandler },
+ { provide: ErrorHandler, useValue: mockErrorHandler },
{ provide: ArtifactService, useValue: mockArtifactService },
{ provide: AppConfigService, useValue: mockAppConfigService },
{ provide: SystemInfoService, useValue: mockSystemInfoService },
diff --git a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.ts
similarity index 91%
rename from src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.ts
index e2d7385391..a2cde5a1c0 100644
--- a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.ts
@@ -3,23 +3,17 @@ import { Observable, of, forkJoin, Subject, Subscription } from 'rxjs';
import { map, catchError, finalize, debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
import { NgForm } from '@angular/forms';
-import { AVAILABLE_TIME } from "../../artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component";
-import {
- ConfirmationAcknowledgement,
- ConfirmationDialogComponent,
- ConfirmationMessage
-} from "../../../../../lib/components/confirmation-dialog";
-import { OperationService } from "../../../../../lib/components/operation/operation.service";
-import { ErrorHandler } from "../../../../../lib/utils/error-handler";
-import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../../../lib/entities/shared.const";
-import { operateChanges, OperateInfo, OperationState } from "../../../../../lib/components/operation/operate";
-import { errorHandler } from "../../../../../lib/utils/shared/shared.utils";
+import { AVAILABLE_TIME } from "../artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component";
+import { OperationService } from "../../../../../shared/components/operation/operation.service";
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
+import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../../../shared/entities/shared.const";
+import { operateChanges, OperateInfo, OperationState } from "../../../../../shared/components/operation/operate";
import { ArtifactFront as Artifact, artifactImages, artifactPullCommands } from '../artifact';
-import { ArtifactService } from '../../../../../../ng-swagger-gen/services/artifact.service';
-import { Tag } from '../../../../../../ng-swagger-gen/models/tag';
+import { ArtifactService } from '../../../../../../../ng-swagger-gen/services/artifact.service';
+import { Tag } from '../../../../../../../ng-swagger-gen/models/tag';
import {
UserPermissionService, USERSTATICPERMISSION, SystemInfoService, SystemInfo
-} from "../../../../../lib/services";
+} from "../../../../../shared/services";
import { ClrDatagridStateInterface } from '@clr/angular';
import {
DEFAULT_PAGE_SIZE,
@@ -27,8 +21,12 @@ import {
dbEncodeURIComponent,
doFiltering,
doSorting
-} from '../../../../../lib/utils/utils';
-import { AppConfigService } from "../../../../services/app-config.service";
+} from '../../../../../shared/units/utils';
+import { AppConfigService } from "../../../../../services/app-config.service";
+import { errorHandler } from "../../../../../shared/units/shared.utils";
+import { ConfirmationDialogComponent } from "../../../../../shared/components/confirmation-dialog";
+import { ConfirmationMessage } from "../../../../global-confirmation-dialog/confirmation-message";
+import { ConfirmationAcknowledgement } from "../../../../global-confirmation-dialog/confirmation-state-message";
class InitTag {
name = "";
diff --git a/src/portal/src/app/base/project/repository/artifact/artifact.module.ts b/src/portal/src/app/base/project/repository/artifact/artifact.module.ts
new file mode 100644
index 0000000000..cda2a12b26
--- /dev/null
+++ b/src/portal/src/app/base/project/repository/artifact/artifact.module.ts
@@ -0,0 +1,75 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../../shared/shared.module";
+import { ArtifactListPageComponent } from "./artifact-list-page/artifact-list-page.component";
+import { ArtifactListComponent } from "./artifact-list-page/artifact-list/artifact-list.component";
+import { ArtifactListTabComponent } from "./artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component";
+import { ArtifactSummaryComponent } from "./artifact-summary.component";
+import { ArtifactTagComponent } from "./artifact-tag/artifact-tag.component";
+import { ArtifactCommonPropertiesComponent } from "./artifact-common-properties/artifact-common-properties.component";
+import { ArtifactAdditionsComponent } from "./artifact-additions/artifact-additions.component";
+import { ValuesComponent } from "./artifact-additions/values/values.component";
+import { SummaryComponent } from "./artifact-additions/summary/summary.component";
+import { DependenciesComponent } from "./artifact-additions/dependencies/dependencies.component";
+import { BuildHistoryComponent } from "./artifact-additions/build-history/build-history.component";
+import { ArtifactVulnerabilitiesComponent } from "./artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component";
+import { ArtifactDefaultService, ArtifactService } from "./artifact.service";
+import { ArtifactDetailRoutingResolverService } from "../../../../services/routing-resolvers/artifact-detail-routing-resolver.service";
+import { ResultTipComponent } from "./vulnerability-scanning/result-tip.component";
+import { ResultBarChartComponent } from "./vulnerability-scanning/result-bar-chart.component";
+import { ResultTipHistogramComponent } from "./vulnerability-scanning/result-tip-histogram/result-tip-histogram.component";
+import { HistogramChartComponent } from "./vulnerability-scanning/histogram-chart/histogram-chart.component";
+
+const routes: Routes = [
+ {
+ path: ':repo',
+ component: ArtifactListPageComponent,
+ },
+ {
+ path: ':repo/depth/:depth',
+ component: ArtifactListPageComponent,
+ },
+ {
+ path: ':repo/artifacts/:digest',
+ component: ArtifactSummaryComponent,
+ resolve: {
+ artifactResolver: ArtifactDetailRoutingResolverService
+ }
+ },
+ {
+ path: ':repo/depth/:depth/artifacts/:digest',
+ component: ArtifactSummaryComponent,
+ resolve: {
+ artifactResolver: ArtifactDetailRoutingResolverService
+ }
+ },
+];
+@NgModule({
+ declarations: [
+ ArtifactListPageComponent,
+ ArtifactListComponent,
+ ArtifactListTabComponent,
+ ArtifactSummaryComponent,
+ ArtifactTagComponent,
+ ArtifactCommonPropertiesComponent,
+ ArtifactAdditionsComponent,
+ ValuesComponent,
+ SummaryComponent,
+ DependenciesComponent,
+ BuildHistoryComponent,
+ ArtifactVulnerabilitiesComponent,
+ ResultTipComponent,
+ ResultBarChartComponent,
+ ResultTipHistogramComponent,
+ HistogramChartComponent
+ ],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ],
+ providers: [
+ ArtifactDefaultService,
+ {provide: ArtifactService, useClass: ArtifactDefaultService },
+ ]
+})
+export class ArtifactModule { }
diff --git a/src/portal/src/app/project/repository/artifact/artifact.service.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact.service.spec.ts
similarity index 58%
rename from src/portal/src/app/project/repository/artifact/artifact.service.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact.service.spec.ts
index 6707f6b0fc..3eab81c633 100644
--- a/src/portal/src/app/project/repository/artifact/artifact.service.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact.service.spec.ts
@@ -1,17 +1,17 @@
import { TestBed, inject } from '@angular/core/testing';
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../lib/entities/service.config";
-import { SharedModule } from "../../../../lib/utils/shared/shared.module";
-import { ArtifactDefaultService, ArtifactService } from "../artifact/artifact.service";
-import { CURRENT_BASE_HREF } from "../../../../lib/utils/utils";
-import { IconService } from '../../../../../ng-swagger-gen/services/icon.service';
+import { ArtifactDefaultService, ArtifactService } from "./artifact.service";
+import { IconService } from '../../../../../../ng-swagger-gen/services/icon.service';
import { DomSanitizer } from '@angular/platform-browser';
+import { SharedTestingModule } from "../../../../shared/shared.module";
+import { HttpClientTestingModule } from "@angular/common/http/testing";
describe('ArtifactService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule
+ SharedTestingModule,
+ HttpClientTestingModule
],
providers: [
ArtifactDefaultService,
diff --git a/src/portal/src/app/project/repository/artifact/artifact.service.ts b/src/portal/src/app/base/project/repository/artifact/artifact.service.ts
similarity index 91%
rename from src/portal/src/app/project/repository/artifact/artifact.service.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact.service.ts
index 10257bf0ed..4a2c7a633c 100644
--- a/src/portal/src/app/project/repository/artifact/artifact.service.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact.service.ts
@@ -1,8 +1,8 @@
import { Injectable, Inject } from "@angular/core";
import { Subject } from "rxjs";
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
-import { Artifact } from '../../../../../ng-swagger-gen/models/artifact';
-import { IconService } from '../../../../../ng-swagger-gen/services/icon.service';
+import { Artifact } from '../../../../../../ng-swagger-gen/models/artifact';
+import { IconService } from '../../../../../../ng-swagger-gen/services/icon.service';
/**
diff --git a/src/portal/src/app/project/repository/artifact/artifact.ts b/src/portal/src/app/base/project/repository/artifact/artifact.ts
similarity index 90%
rename from src/portal/src/app/project/repository/artifact/artifact.ts
rename to src/portal/src/app/base/project/repository/artifact/artifact.ts
index c54d36784e..78f4b6bfaf 100644
--- a/src/portal/src/app/project/repository/artifact/artifact.ts
+++ b/src/portal/src/app/base/project/repository/artifact/artifact.ts
@@ -1,5 +1,5 @@
-import { Artifact } from "../../../../../ng-swagger-gen/models/artifact";
-import { Platform } from "../../../../../ng-swagger-gen/models/platform";
+import { Artifact } from "../../../../../../ng-swagger-gen/models/artifact";
+import { Platform } from "../../../../../../ng-swagger-gen/models/platform";
export interface ArtifactFront extends Artifact {
platform?: Platform;
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.html b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.html
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.html
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.scss b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.scss
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.scss
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.spec.ts
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.spec.ts
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.ts
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/histogram-chart/histogram-chart.component.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/histogram-chart/histogram-chart.component.ts
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart-component.html b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart-component.html
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart-component.html
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart-component.html
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart.component.spec.ts
similarity index 79%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart.component.spec.ts
index 2b6e4a4b49..5ff726804a 100644
--- a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart.component.spec.ts
@@ -3,27 +3,22 @@ import { ResultBarChartComponent } from './result-bar-chart.component';
import { ResultTipComponent } from './result-tip.component';
import { ResultTipHistogramComponent } from "./result-tip-histogram/result-tip-histogram.component";
import { HistogramChartComponent } from "./histogram-chart/histogram-chart.component";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../lib/entities/service.config";
import {
JobLogDefaultService,
JobLogService,
ScanningResultDefaultService,
ScanningResultService,
-} from "../../../../lib/services";
-import { CURRENT_BASE_HREF, VULNERABILITY_SCAN_STATUS } from "../../../../lib/utils/utils";
-import { SharedModule } from "../../../../lib/utils/shared/shared.module";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
-import { ChannelService } from "../../../../lib/services/channel.service";
-import { ArtifactDefaultService, ArtifactService } from "../artifact/artifact.service";
-import { NativeReportSummary } from "../../../../../ng-swagger-gen/models/native-report-summary";
+} from "../../../../../shared/services";
+import { CURRENT_BASE_HREF, VULNERABILITY_SCAN_STATUS } from "../../../../../shared/units/utils";
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
+import { ChannelService } from "../../../../../shared/services/channel.service";
+import { ArtifactDefaultService, ArtifactService } from "../artifact.service";
+import { NativeReportSummary } from "../../../../../../../ng-swagger-gen/models/native-report-summary";
+import { SharedTestingModule } from "../../../../../shared/shared.module";
describe('ResultBarChartComponent (inline template)', () => {
let component: ResultBarChartComponent;
let fixture: ComponentFixture;
- let serviceConfig: IServiceConfig;
- let testConfig: IServiceConfig = {
- vulnerabilityScanningBaseEndpoint: CURRENT_BASE_HREF + "/vulnerability/testing"
- };
let mockData: NativeReportSummary = {
scan_status: VULNERABILITY_SCAN_STATUS.SUCCESS,
severity: "High",
@@ -41,7 +36,7 @@ describe('ResultBarChartComponent (inline template)', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule
+ SharedTestingModule
],
declarations: [
ResultBarChartComponent,
@@ -52,7 +47,6 @@ describe('ResultBarChartComponent (inline template)', () => {
ErrorHandler,
ChannelService,
ArtifactDefaultService,
- { provide: SERVICE_CONFIG, useValue: testConfig },
{ provide: ArtifactService, useValue: ArtifactDefaultService },
{ provide: ScanningResultService, useValue: ScanningResultDefaultService },
{ provide: JobLogService, useValue: JobLogDefaultService}
@@ -66,16 +60,11 @@ describe('ResultBarChartComponent (inline template)', () => {
component = fixture.componentInstance;
component.artifactDigest = "mockTag";
component.summary = mockData;
-
- serviceConfig = TestBed.get(SERVICE_CONFIG);
-
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
- expect(serviceConfig).toBeTruthy();
- expect(serviceConfig.vulnerabilityScanningBaseEndpoint).toEqual(CURRENT_BASE_HREF + "/vulnerability/testing");
});
it('should show "not scanned" if status is STOPPED', () => {
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart.component.ts
similarity index 91%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart.component.ts
index 5f255cd196..9156331270 100644
--- a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-bar-chart.component.ts
@@ -3,22 +3,22 @@ import {
Input,
OnInit,
OnDestroy,
- ChangeDetectorRef, Output, EventEmitter,
+ Output, EventEmitter,
} from '@angular/core';
import { Subscription , timer} from "rxjs";
import { finalize } from "rxjs/operators";
-import { ScannerVo, ScanningResultService } from "../../../../lib/services";
-import { ErrorHandler } from "../../../../lib/utils/error-handler";
-import { ChannelService } from "../../../../lib/services/channel.service";
+import { ScannerVo, ScanningResultService } from "../../../../../shared/services";
+import { ErrorHandler } from "../../../../../shared/units/error-handler";
+import { ChannelService } from "../../../../../shared/services/channel.service";
import {
clone,
CURRENT_BASE_HREF,
VULNERABILITY_SCAN_STATUS,
dbEncodeURIComponent
-} from "../../../../lib/utils/utils";
-import { ArtifactService } from "../../../../../ng-swagger-gen/services/artifact.service";
-import { Artifact } from "../../../../../ng-swagger-gen/models/artifact";
-import { NativeReportSummary } from "../../../../../ng-swagger-gen/models/native-report-summary";
+} from "../../../../../shared/units/utils";
+import { ArtifactService } from "../../../../../../../ng-swagger-gen/services/artifact.service";
+import { Artifact } from "../../../../../../../ng-swagger-gen/models/artifact";
+import { NativeReportSummary } from "../../../../../../../ng-swagger-gen/models/native-report-summary";
const STATE_CHECK_INTERVAL: number = 3000; // 3s
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.html b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.html
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.html
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.spec.ts
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.spec.ts
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.ts
similarity index 99%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.ts
index 49e184f412..08f7e57f7d 100644
--- a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.ts
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { TranslateService } from "@ngx-translate/core";
-import { ScannerVo, VulnerabilitySummary } from "../../../../../lib/services";
-import { VULNERABILITY_SCAN_STATUS, VULNERABILITY_SEVERITY } from "../../../../../lib/utils/utils";
+import { ScannerVo, VulnerabilitySummary } from "../../../../../../shared/services";
+import { VULNERABILITY_SCAN_STATUS, VULNERABILITY_SEVERITY } from "../../../../../../shared/units/utils";
const MIN = 60;
const MIN_STR = "min ";
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.component.spec.ts
similarity index 79%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-tip.component.spec.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.component.spec.ts
index 8c8512649d..6007043cdd 100644
--- a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.component.spec.ts
@@ -1,17 +1,13 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { ResultTipComponent } from './result-tip.component';
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../lib/entities/service.config";
-import { UserPermissionDefaultService, UserPermissionService, VulnerabilitySummary } from "../../../../lib/services";
-import { CURRENT_BASE_HREF, VULNERABILITY_SCAN_STATUS } from "../../../../lib/utils/utils";
-import { SharedModule } from "../../../../lib/utils/shared/shared.module";
+import { UserPermissionDefaultService, UserPermissionService, VulnerabilitySummary } from "../../../../../shared/services";
+import { CURRENT_BASE_HREF, VULNERABILITY_SCAN_STATUS } from "../../../../../shared/units/utils";
+import { SharedTestingModule } from "../../../../../shared/shared.module";
describe('ResultTipComponent (inline template)', () => {
let component: ResultTipComponent;
let fixture: ComponentFixture;
- let testConfig: IServiceConfig = {
- vulnerabilityScanningBaseEndpoint: CURRENT_BASE_HREF + "/vulnerability/testing"
- };
let mockData: VulnerabilitySummary = {
scan_status: VULNERABILITY_SCAN_STATUS.SUCCESS,
severity: "High",
@@ -29,10 +25,10 @@ describe('ResultTipComponent (inline template)', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule
+ SharedTestingModule
],
declarations: [ResultTipComponent],
- providers: [{ provide: SERVICE_CONFIG, useValue: testConfig },
+ providers: [
{ provide: UserPermissionService, useClass: UserPermissionDefaultService }]
});
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip.component.ts b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.component.ts
similarity index 97%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-tip.component.ts
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.component.ts
index 789751dd18..fe046ef70f 100644
--- a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip.component.ts
+++ b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
-import { VulnerabilitySeverity, VulnerabilitySummary } from "../../../../lib/services";
-import { VULNERABILITY_SCAN_STATUS } from "../../../../lib/utils/utils";
+import { VulnerabilitySeverity, VulnerabilitySummary } from "../../../../../shared/services";
+import { VULNERABILITY_SCAN_STATUS } from "../../../../../shared/units/utils";
export const MIN_TIP_WIDTH = 5;
export const MAX_TIP_WIDTH = 100;
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip.componnent.html b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.componnent.html
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/result-tip.componnent.html
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/result-tip.componnent.html
diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/scanning.scss b/src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/scanning.scss
similarity index 100%
rename from src/portal/src/app/project/repository/vulnerability-scanning/scanning.scss
rename to src/portal/src/app/base/project/repository/artifact/vulnerability-scanning/scanning.scss
diff --git a/src/portal/src/app/project/repository/gridview/grid-view.component.html b/src/portal/src/app/base/project/repository/gridview/grid-view.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/gridview/grid-view.component.html
rename to src/portal/src/app/base/project/repository/gridview/grid-view.component.html
diff --git a/src/portal/src/app/project/repository/gridview/grid-view.component.scss b/src/portal/src/app/base/project/repository/gridview/grid-view.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/gridview/grid-view.component.scss
rename to src/portal/src/app/base/project/repository/gridview/grid-view.component.scss
diff --git a/src/portal/src/app/project/repository/gridview/grid-view.component.spec.ts b/src/portal/src/app/base/project/repository/gridview/grid-view.component.spec.ts
similarity index 79%
rename from src/portal/src/app/project/repository/gridview/grid-view.component.spec.ts
rename to src/portal/src/app/base/project/repository/gridview/grid-view.component.spec.ts
index 75cc456245..303265ad95 100644
--- a/src/portal/src/app/project/repository/gridview/grid-view.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/gridview/grid-view.component.spec.ts
@@ -11,28 +11,20 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { GridViewComponent } from './grid-view.component';
-import { IServiceConfig, SERVICE_CONFIG } from "../../../../lib/entities/service.config";
-import { SharedModule } from "../../../../lib/utils/shared/shared.module";
-
+import { SharedTestingModule } from "../../../../shared/shared.module";
describe('GridViewComponent', () => {
let component: GridViewComponent;
let fixture: ComponentFixture;
-
- let config: IServiceConfig = {
- };
-
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule,
+ SharedTestingModule,
],
declarations: [
GridViewComponent,
],
- providers: [{
- provide: SERVICE_CONFIG, useValue: config }]
}).compileComponents();
}));
diff --git a/src/portal/src/app/project/repository/gridview/grid-view.component.ts b/src/portal/src/app/base/project/repository/gridview/grid-view.component.ts
similarity index 99%
rename from src/portal/src/app/project/repository/gridview/grid-view.component.ts
rename to src/portal/src/app/base/project/repository/gridview/grid-view.component.ts
index 31c30684e1..70bdd78210 100644
--- a/src/portal/src/app/project/repository/gridview/grid-view.component.ts
+++ b/src/portal/src/app/base/project/repository/gridview/grid-view.component.ts
@@ -24,7 +24,7 @@ import {
} from "@angular/core";
import { Subscription } from "rxjs";
import { TranslateService } from "@ngx-translate/core";
-import { ScrollPosition } from "../../../../lib/services";
+import { ScrollPosition } from "../../../../shared/services";
@Component({
selector: "hbr-gridview",
diff --git a/src/portal/src/app/project/repository/repository-gridview.component.html b/src/portal/src/app/base/project/repository/repository-gridview.component.html
similarity index 100%
rename from src/portal/src/app/project/repository/repository-gridview.component.html
rename to src/portal/src/app/base/project/repository/repository-gridview.component.html
diff --git a/src/portal/src/app/project/repository/repository-gridview.component.scss b/src/portal/src/app/base/project/repository/repository-gridview.component.scss
similarity index 100%
rename from src/portal/src/app/project/repository/repository-gridview.component.scss
rename to src/portal/src/app/base/project/repository/repository-gridview.component.scss
diff --git a/src/portal/src/app/project/repository/repository-gridview.component.spec.ts b/src/portal/src/app/base/project/repository/repository-gridview.component.spec.ts
similarity index 74%
rename from src/portal/src/app/project/repository/repository-gridview.component.spec.ts
rename to src/portal/src/app/base/project/repository/repository-gridview.component.spec.ts
index 09fd8c71d0..31f38fa4ea 100644
--- a/src/portal/src/app/project/repository/repository-gridview.component.spec.ts
+++ b/src/portal/src/app/base/project/repository/repository-gridview.component.spec.ts
@@ -1,24 +1,18 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
import { of } from "rxjs";
-import { RepositoryService as NewRepositoryService } from "../../../../ng-swagger-gen/services/repository.service";
+import { RepositoryService as NewRepositoryService } from "../../../../../ng-swagger-gen/services/repository.service";
import { RepositoryGridviewComponent } from "./repository-gridview.component";
import {
ProjectDefaultService,
ProjectService,
SystemInfo, SystemInfoService,
UserPermissionService
-} from "../../../lib/services";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../lib/entities/service.config";
+} from "../../../shared/services";
import { delay } from 'rxjs/operators';
-import { SharedModule } from "../../../lib/utils/shared/shared.module";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
-import { OperationService } from "../../../lib/components/operation/operation.service";
-import { ProjectModule } from "../project.module";
+import { ErrorHandler } from "../../../shared/units/error-handler";
import { ActivatedRoute } from "@angular/router";
-import { Repository as NewRepository } from "../../../../ng-swagger-gen/models/repository";
-import { StrictHttpResponse as __StrictHttpResponse } from '../../../../ng-swagger-gen/strict-http-response';
-import { CURRENT_BASE_HREF } from "../../../lib/utils/utils";
+import { Repository as NewRepository } from "../../../../../ng-swagger-gen/models/repository";
+import { SharedTestingModule } from "../../../shared/shared.module";
describe('RepositoryComponentGridview (inline template)', () => {
@@ -66,11 +60,6 @@ describe('RepositoryComponentGridview (inline template)', () => {
let mockRepo: NewRepository[] = mockRepoData;
let mockNginxRepo: NewRepository[] = mockRepoNginxData;
- let config: IServiceConfig = {
- repositoryBaseEndpoint: CURRENT_BASE_HREF + '/repository/testing',
- systemInfoEndpoint: CURRENT_BASE_HREF + '/systeminfo/testing',
- targetBaseEndpoint: CURRENT_BASE_HREF + '/tag/testing'
- };
const fakedErrorHandler = {
error() {
return undefined;
@@ -97,8 +86,10 @@ describe('RepositoryComponentGridview (inline template)', () => {
const fakedActivatedRoute = {
snapshot: {
parent: {
- params: {
- id: "1"
+ parent: {
+ params: {
+ id: "1"
+ }
}
}
}
@@ -106,19 +97,18 @@ describe('RepositoryComponentGridview (inline template)', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule,
- RouterTestingModule,
- ProjectModule
+ SharedTestingModule,
+ ],
+ declarations: [
+ RepositoryGridviewComponent
],
providers: [
{ provide: ActivatedRoute, useValue: fakedActivatedRoute },
{ provide: ErrorHandler, useValue: fakedErrorHandler },
- { provide: SERVICE_CONFIG, useValue: config },
{ provide: NewRepositoryService, useValue: fakedRepositoryService },
{ provide: ProjectService, useClass: ProjectDefaultService },
{ provide: SystemInfoService, useValue: fakedSystemInfoService },
{ provide: UserPermissionService, useValue: fakedUserPermissionService },
- { provide: OperationService },
]
});
}));
diff --git a/src/portal/src/app/project/repository/repository-gridview.component.ts b/src/portal/src/app/base/project/repository/repository-gridview.component.ts
similarity index 91%
rename from src/portal/src/app/project/repository/repository-gridview.component.ts
rename to src/portal/src/app/base/project/repository/repository-gridview.component.ts
index 27b9ff5c15..6bc7c17c25 100644
--- a/src/portal/src/app/project/repository/repository-gridview.component.ts
+++ b/src/portal/src/app/base/project/repository/repository-gridview.component.ts
@@ -7,7 +7,7 @@ import {
EventEmitter,
OnChanges,
SimpleChanges,
- Inject, OnDestroy
+ OnDestroy
} from "@angular/core";
import {forkJoin, of, Subscription} from "rxjs";
import { debounceTime, distinctUntilChanged, switchMap } from "rxjs/operators";
@@ -17,39 +17,38 @@ import { Observable } from "rxjs";
import { ClrDatagridStateInterface } from "@clr/angular";
import {
RepositoryService as NewRepositoryService
-} from "../../../../ng-swagger-gen/services/repository.service";
+} from "../../../../../ng-swagger-gen/services/repository.service";
import {
SystemInfo,
SystemInfoService,
UserPermissionService, USERSTATICPERMISSION
-} from "../../../lib/services";
-import { FilterComponent } from "../../../lib/components/filter/filter.component";
+} from "../../../shared/services";
+import { FilterComponent } from "../../../shared/components/filter/filter.component";
import {
calculatePage,
clone,
DEFAULT_PAGE_SIZE,
dbEncodeURIComponent,
doFiltering,
- doSorting
-} from "../../../lib/utils/utils";
-import { IServiceConfig, SERVICE_CONFIG } from "../../../lib/entities/service.config";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
-import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../lib/entities/shared.const";
-import { operateChanges, OperateInfo, OperationState } from "../../../lib/components/operation/operate";
+ doSorting, CURRENT_BASE_HREF
+} from "../../../shared/units/utils";
+import { ErrorHandler } from "../../../shared/units/error-handler";
+import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../shared/entities/shared.const";
+import { operateChanges, OperateInfo, OperationState } from "../../../shared/components/operation/operate";
import {
- ConfirmationAcknowledgement,
ConfirmationDialogComponent,
- ConfirmationMessage
-} from "../../../lib/components/confirmation-dialog";
-import { OperationService } from "../../../lib/components/operation/operation.service";
-import { errorHandler } from "../../../lib/utils/shared/shared.utils";
+} from "../../../shared/components/confirmation-dialog";
+import { OperationService } from "../../../shared/components/operation/operation.service";
import { Project } from "../project";
import { ActivatedRoute, Router } from "@angular/router";
-import { SessionService } from "../../shared/session.service";
+import { SessionService } from "../../../shared/services/session.service";
import { GridViewComponent } from "./gridview/grid-view.component";
-import { Repository as NewRepository } from "../../../../ng-swagger-gen/models/repository";
-import { StrictHttpResponse as __StrictHttpResponse } from '../../../../ng-swagger-gen/strict-http-response';
+import { Repository as NewRepository } from "../../../../../ng-swagger-gen/models/repository";
+import { StrictHttpResponse as __StrictHttpResponse } from '../../../../../ng-swagger-gen/strict-http-response';
import {HttpErrorResponse} from "@angular/common/http";
+import { errorHandler } from "../../../shared/units/shared.utils";
+import { ConfirmationAcknowledgement } from "../../global-confirmation-dialog/confirmation-state-message";
+import { ConfirmationMessage } from "../../global-confirmation-dialog/confirmation-message";
@Component({
@@ -96,7 +95,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
searchSub: Subscription;
isProxyCacheProject: boolean = false;
- constructor(@Inject(SERVICE_CONFIG) private configInfo: IServiceConfig,
+ constructor(
private errorHandlerService: ErrorHandler,
private translateService: TranslateService,
private newRepoService: NewRepositoryService,
@@ -107,9 +106,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
private session: SessionService,
private router: Router,
) {
- if (this.configInfo && this.configInfo.systemInfoEndpoint) {
- this.downloadLink = this.configInfo.systemInfoEndpoint + "/getcert";
- }
+ this.downloadLink = CURRENT_BASE_HREF + "/systeminfo/getcert";
}
public get registryUrl(): string {
@@ -135,8 +132,8 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
}
ngOnInit(): void {
- this.projectId = this.route.snapshot.parent.params['id'];
- let resolverData = this.route.snapshot.parent.data;
+ this.projectId = this.route.snapshot.parent.parent.params['id'];
+ let resolverData = this.route.snapshot.parent.parent.data;
if (resolverData) {
let pro: Project = resolverData['projectResolver'];
this.hasProjectAdminRole = pro.has_project_admin_role;
diff --git a/src/portal/src/app/base/project/repository/repository.module.ts b/src/portal/src/app/base/project/repository/repository.module.ts
new file mode 100644
index 0000000000..334c4f06a6
--- /dev/null
+++ b/src/portal/src/app/base/project/repository/repository.module.ts
@@ -0,0 +1,23 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { RepositoryGridviewComponent } from "./repository-gridview.component";
+import { GridViewComponent } from "./gridview/grid-view.component";
+
+const routes: Routes = [
+ {
+ path: '',
+ component: RepositoryGridviewComponent
+ }
+];
+@NgModule({
+ declarations: [
+ RepositoryGridviewComponent,
+ GridViewComponent
+ ],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ]
+})
+export class RepositoryModule { }
diff --git a/src/portal/src/app/project/robot-account/add-robot/add-robot.component.html b/src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.html
similarity index 100%
rename from src/portal/src/app/project/robot-account/add-robot/add-robot.component.html
rename to src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.html
diff --git a/src/portal/src/app/project/robot-account/add-robot/add-robot.component.scss b/src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.scss
similarity index 100%
rename from src/portal/src/app/project/robot-account/add-robot/add-robot.component.scss
rename to src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.scss
diff --git a/src/portal/src/app/project/robot-account/add-robot/add-robot.component.spec.ts b/src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.spec.ts
similarity index 80%
rename from src/portal/src/app/project/robot-account/add-robot/add-robot.component.spec.ts
rename to src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.spec.ts
index 51f01e4d0c..024fa14773 100644
--- a/src/portal/src/app/project/robot-account/add-robot/add-robot.component.spec.ts
+++ b/src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.spec.ts
@@ -3,14 +3,14 @@ import { ClarityModule } from '@clr/angular';
import { AddRobotComponent } from './add-robot.component';
import { FormsModule } from '@angular/forms';
import { of } from "rxjs";
-import { MessageHandlerService } from "../../../shared/message-handler/message-handler.service";
+import { MessageHandlerService } from "../../../../shared/services/message-handler.service";
import { TranslateModule } from '@ngx-translate/core';
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { delay } from "rxjs/operators";
-import { RobotService } from "../../../../../ng-swagger-gen/services/robot.service";
-import { OperationService } from "../../../../lib/components/operation/operation.service";
+import { RobotService } from "../../../../../../ng-swagger-gen/services/robot.service";
+import { OperationService } from "../../../../shared/components/operation/operation.service";
import { NO_ERRORS_SCHEMA } from "@angular/core";
-import { SharedModule } from "../../../shared/shared.module";
+import { SharedTestingModule } from "../../../../shared/shared.module";
describe('AddRobotComponent', () => {
let component: AddRobotComponent;
@@ -34,7 +34,7 @@ describe('AddRobotComponent', () => {
ClarityModule,
TranslateModule.forRoot(),
FormsModule,
- SharedModule
+ SharedTestingModule
],
providers: [
OperationService,
diff --git a/src/portal/src/app/project/robot-account/add-robot/add-robot.component.ts b/src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.ts
similarity index 92%
rename from src/portal/src/app/project/robot-account/add-robot/add-robot.component.ts
rename to src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.ts
index 0a758d2ed4..beed076221 100644
--- a/src/portal/src/app/project/robot-account/add-robot/add-robot.component.ts
+++ b/src/portal/src/app/base/project/robot-account/add-robot/add-robot.component.ts
@@ -5,23 +5,23 @@ import {
OnDestroy, Output, EventEmitter, ViewChild,
} from "@angular/core";
import { debounceTime, distinctUntilChanged, filter, finalize, switchMap } from "rxjs/operators";
-import { MessageHandlerService } from "../../../shared/message-handler/message-handler.service";
+import { MessageHandlerService } from "../../../../shared/services/message-handler.service";
import {
ACTION_RESOURCE_I18N_MAP,
ExpirationType,
FrontAccess, INITIAL_ACCESSES, onlyHasPushPermission, PermissionsKinds
-} from "../../../system-robot-accounts/system-robot-util";
-import { Robot } from "../../../../../ng-swagger-gen/models/robot";
-import { InlineAlertComponent } from "../../../shared/inline-alert/inline-alert.component";
+} from "../../../left-side-nav/system-robot-accounts/system-robot-util";
+import { Robot } from "../../../../../../ng-swagger-gen/models/robot";
import { NgForm } from "@angular/forms";
import { ClrLoadingState } from "@clr/angular";
import { Subject, Subscription } from "rxjs";
-import { RobotService } from "../../../../../ng-swagger-gen/services/robot.service";
-import { OperationService } from "../../../../lib/components/operation/operation.service";
-import { clone } from "../../../../lib/utils/utils";
-import { operateChanges, OperateInfo, OperationState } from "../../../../lib/components/operation/operate";
-import { errorHandler } from "../../../../lib/utils/shared/shared.utils";
-import { Access } from "../../../../../ng-swagger-gen/models/access";
+import { RobotService } from "../../../../../../ng-swagger-gen/services/robot.service";
+import { OperationService } from "../../../../shared/components/operation/operation.service";
+import { clone } from "../../../../shared/units/utils";
+import { operateChanges, OperateInfo, OperationState } from "../../../../shared/components/operation/operate";
+import { Access } from "../../../../../../ng-swagger-gen/models/access";
+import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component";
+import { errorHandler } from "../../../../shared/units/shared.utils";
const MINI_SECONDS_ONE_DAY: number = 60 * 24 * 60 * 1000;
@Component({
diff --git a/src/portal/src/app/base/project/robot-account/project-robot-account.module.ts b/src/portal/src/app/base/project/robot-account/project-robot-account.module.ts
new file mode 100644
index 0000000000..b7170c0f16
--- /dev/null
+++ b/src/portal/src/app/base/project/robot-account/project-robot-account.module.ts
@@ -0,0 +1,24 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { RobotAccountComponent } from "./robot-account.component";
+import { AddRobotComponent } from "./add-robot/add-robot.component";
+
+
+const routes: Routes = [
+ {
+ path: '',
+ component: RobotAccountComponent
+ }
+];
+@NgModule({
+ declarations: [
+ AddRobotComponent,
+ RobotAccountComponent
+ ],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ]
+})
+export class ProjectRobotAccountModule { }
diff --git a/src/portal/src/app/project/robot-account/robot-account.component.html b/src/portal/src/app/base/project/robot-account/robot-account.component.html
similarity index 100%
rename from src/portal/src/app/project/robot-account/robot-account.component.html
rename to src/portal/src/app/base/project/robot-account/robot-account.component.html
diff --git a/src/portal/src/app/project/robot-account/robot-account.component.scss b/src/portal/src/app/base/project/robot-account/robot-account.component.scss
similarity index 93%
rename from src/portal/src/app/project/robot-account/robot-account.component.scss
rename to src/portal/src/app/base/project/robot-account/robot-account.component.scss
index 8bbdf9c81c..5beb6f0c09 100644
--- a/src/portal/src/app/project/robot-account/robot-account.component.scss
+++ b/src/portal/src/app/base/project/robot-account/robot-account.component.scss
@@ -1,4 +1,4 @@
-@import "../../../lib/mixin";
+@import "../../../shared/mixin";
.robot-space {
margin-top: 28px;
diff --git a/src/portal/src/app/project/robot-account/robot-account.component.spec.ts b/src/portal/src/app/base/project/robot-account/robot-account.component.spec.ts
similarity index 78%
rename from src/portal/src/app/project/robot-account/robot-account.component.spec.ts
rename to src/portal/src/app/base/project/robot-account/robot-account.component.spec.ts
index 7cff257681..a01f6a2434 100644
--- a/src/portal/src/app/project/robot-account/robot-account.component.spec.ts
+++ b/src/portal/src/app/base/project/robot-account/robot-account.component.spec.ts
@@ -1,21 +1,18 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
-import { ClarityModule } from '@clr/angular';
import { of, Subscription } from 'rxjs';
import { ActivatedRoute } from "@angular/router";
-import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
-import { TranslateModule } from '@ngx-translate/core';
-import { ConfirmationDialogService } from "../../shared/confirmation-dialog/confirmation-dialog.service";
+import { MessageHandlerService } from "../../../shared/services/message-handler.service";
import { RobotAccountComponent } from './robot-account.component';
-import { UserPermissionService } from "../../../lib/services";
-import { OperationService } from "../../../lib/components/operation/operation.service";
-import { RobotService } from "../../../../ng-swagger-gen/services/robot.service";
+import { UserPermissionService } from "../../../shared/services";
+import { OperationService } from "../../../shared/components/operation/operation.service";
+import { RobotService } from "../../../../../ng-swagger-gen/services/robot.service";
import { HttpHeaders, HttpResponse } from "@angular/common/http";
-import { Robot } from "../../../../ng-swagger-gen/models/robot";
+import { Robot } from "../../../../../ng-swagger-gen/models/robot";
import { delay } from "rxjs/operators";
-import { Action, PermissionsKinds, Resource } from "../../system-robot-accounts/system-robot-util";
-import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
-import { HttpClientTestingModule } from "@angular/common/http/testing";
+import { Action, PermissionsKinds, Resource } from "../../left-side-nav/system-robot-accounts/system-robot-util";
+import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service";
+import { SharedTestingModule } from "../../../shared/shared.module";
describe('RobotAccountComponent', () => {
let component: RobotAccountComponent;
@@ -109,18 +106,17 @@ describe('RobotAccountComponent', () => {
NO_ERRORS_SCHEMA
],
imports: [
- BrowserAnimationsModule,
- ClarityModule,
- TranslateModule.forRoot(),
- HttpClientTestingModule
+ SharedTestingModule,
],
providers: [
{
provide: ActivatedRoute, useValue: {
snapshot: {
parent: {
- params: { id: 1 },
- data: null
+ parent: {
+ params: { id: 1 },
+ data: null
+ }
},
}
}
diff --git a/src/portal/src/app/project/robot-account/robot-account.component.ts b/src/portal/src/app/base/project/robot-account/robot-account.component.ts
similarity index 90%
rename from src/portal/src/app/project/robot-account/robot-account.component.ts
rename to src/portal/src/app/base/project/robot-account/robot-account.component.ts
index bf782e3cff..ed994126d4 100644
--- a/src/portal/src/app/project/robot-account/robot-account.component.ts
+++ b/src/portal/src/app/base/project/robot-account/robot-account.component.ts
@@ -2,29 +2,29 @@ import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ClrDatagridStateInterface, ClrLoadingState } from "@clr/angular";
import { catchError, debounceTime, distinctUntilChanged, finalize, map, switchMap } from "rxjs/operators";
import { forkJoin, Observable, of, Subscription } from "rxjs";
-import { UserPermissionService, USERSTATICPERMISSION } from "../../../lib/services";
+import { UserPermissionService, USERSTATICPERMISSION } from "../../../shared/services";
import {
ACTION_RESOURCE_I18N_MAP,
PermissionsKinds
-} from "../../system-robot-accounts/system-robot-util";
-import { clone, DEFAULT_PAGE_SIZE } from "../../../lib/utils/utils";
-import { ViewTokenComponent } from "../../system-robot-accounts/view-token/view-token.component";
-import { FilterComponent } from "../../../lib/components/filter/filter.component";
-import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
-import { ConfirmationDialogService } from "../../shared/confirmation-dialog/confirmation-dialog.service";
-import { OperationService } from "../../../lib/components/operation/operation.service";
-import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../shared/shared.const";
-import { RobotService } from "../../../../ng-swagger-gen/services/robot.service";
-import { Robot } from "../../../../ng-swagger-gen/models/robot";
+} from "../../left-side-nav/system-robot-accounts/system-robot-util";
+import { clone, DEFAULT_PAGE_SIZE } from "../../../shared/units/utils";
+import { ViewTokenComponent } from "../../../shared/components/view-token/view-token.component";
+import { FilterComponent } from "../../../shared/components/filter/filter.component";
+import { MessageHandlerService } from "../../../shared/services/message-handler.service";
+import { OperationService } from "../../../shared/components/operation/operation.service";
+import { RobotService } from "../../../../../ng-swagger-gen/services/robot.service";
+import { Robot } from "../../../../../ng-swagger-gen/models/robot";
import { ActivatedRoute } from "@angular/router";
-import { Project } from "../../../../ng-swagger-gen/models/project";
+import { Project } from "../../../../../ng-swagger-gen/models/project";
import { HttpErrorResponse } from "@angular/common/http";
-import { errorHandler } from "../../../lib/utils/shared/shared.utils";
-import { operateChanges, OperateInfo, OperationState } from "../../../lib/components/operation/operate";
-import { ConfirmationMessage } from "../../shared/confirmation-dialog/confirmation-message";
+import { operateChanges, OperateInfo, OperationState } from "../../../shared/components/operation/operate";
import { AddRobotComponent } from "./add-robot/add-robot.component";
import { TranslateService } from "@ngx-translate/core";
import { DomSanitizer } from "@angular/platform-browser";
+import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service";
+import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../shared/entities/shared.const";
+import { errorHandler } from "../../../shared/units/shared.utils";
+import { ConfirmationMessage } from "../../global-confirmation-dialog/confirmation-message";
@Component({
selector: "app-robot-account",
@@ -65,8 +65,8 @@ export class RobotAccountComponent implements OnInit, OnDestroy {
private sanitizer: DomSanitizer,
) {}
ngOnInit() {
- this.projectId = +this.route.snapshot.parent.params["id"];
- let resolverData = this.route.snapshot.parent.data;
+ this.projectId = +this.route.snapshot.parent.parent.params["id"];
+ let resolverData = this.route.snapshot.parent.parent.data;
if (resolverData) {
let project = resolverData["projectResolver"];
this.projectName = project.name;
diff --git a/src/portal/src/app/base/project/scanner/project-scanner.module.ts b/src/portal/src/app/base/project/scanner/project-scanner.module.ts
new file mode 100644
index 0000000000..13e0a22aaf
--- /dev/null
+++ b/src/portal/src/app/base/project/scanner/project-scanner.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+import { ScannerComponent } from "./scanner.component";
+
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ScannerComponent
+ }
+];
+@NgModule({
+ declarations: [ScannerComponent],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ]
+})
+export class ProjectScannerModule { }
diff --git a/src/portal/src/app/project/scanner/scanner.component.html b/src/portal/src/app/base/project/scanner/scanner.component.html
similarity index 100%
rename from src/portal/src/app/project/scanner/scanner.component.html
rename to src/portal/src/app/base/project/scanner/scanner.component.html
diff --git a/src/portal/src/app/project/scanner/scanner.component.scss b/src/portal/src/app/base/project/scanner/scanner.component.scss
similarity index 100%
rename from src/portal/src/app/project/scanner/scanner.component.scss
rename to src/portal/src/app/base/project/scanner/scanner.component.scss
diff --git a/src/portal/src/app/project/scanner/scanner.component.spec.ts b/src/portal/src/app/base/project/scanner/scanner.component.spec.ts
similarity index 81%
rename from src/portal/src/app/project/scanner/scanner.component.spec.ts
rename to src/portal/src/app/base/project/scanner/scanner.component.spec.ts
index 52ad60c936..cfda67908f 100644
--- a/src/portal/src/app/project/scanner/scanner.component.spec.ts
+++ b/src/portal/src/app/base/project/scanner/scanner.component.spec.ts
@@ -1,15 +1,13 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
-import { ClarityModule } from "@clr/angular";
import { of } from "rxjs";
import { TranslateService } from "@ngx-translate/core";
-import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
+import { MessageHandlerService } from "../../../shared/services/message-handler.service";
import { ScannerComponent } from "./scanner.component";
-import { ConfigScannerService } from "../../config/scanner/config-scanner.service";
-import { SharedModule } from "../../shared/shared.module";
+import { ConfigScannerService } from "../../left-side-nav/interrogation-services/scanner/config-scanner.service";
+import { SharedTestingModule } from "../../../shared/shared.module";
import { ActivatedRoute } from "@angular/router";
-import { Scanner } from "../../config/scanner/scanner";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
+import { Scanner } from "../../left-side-nav/interrogation-services/scanner/scanner";
+import { ErrorHandler } from "../../../shared/units/error-handler";
describe('ScannerComponent', () => {
const mockScanner1: Scanner = {
@@ -47,8 +45,10 @@ describe('ScannerComponent', () => {
let fakedRoute = {
snapshot: {
parent: {
- params: {
- id: 1
+ parent: {
+ params: {
+ id: 1
+ }
}
}
}
@@ -56,9 +56,7 @@ describe('ScannerComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
- SharedModule,
- BrowserAnimationsModule,
- ClarityModule,
+ SharedTestingModule,
],
declarations: [ ScannerComponent ],
providers: [
diff --git a/src/portal/src/app/project/scanner/scanner.component.ts b/src/portal/src/app/base/project/scanner/scanner.component.ts
similarity index 89%
rename from src/portal/src/app/project/scanner/scanner.component.ts
rename to src/portal/src/app/base/project/scanner/scanner.component.ts
index 8da041a271..b7be97ae99 100644
--- a/src/portal/src/app/project/scanner/scanner.component.ts
+++ b/src/portal/src/app/base/project/scanner/scanner.component.ts
@@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component, OnInit, ViewChild } from "@angular/core";
-import { ConfigScannerService } from "../../config/scanner/config-scanner.service";
-import { Scanner } from "../../config/scanner/scanner";
-import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
+import { ConfigScannerService } from "../../left-side-nav/interrogation-services/scanner/config-scanner.service";
+import { Scanner } from "../../left-side-nav/interrogation-services/scanner/scanner";
+import { MessageHandlerService } from "../../../shared/services/message-handler.service";
import { ActivatedRoute } from "@angular/router";
import { ClrLoadingState } from "@clr/angular";
-import { InlineAlertComponent } from "../../shared/inline-alert/inline-alert.component";
import { finalize } from "rxjs/operators";
import { TranslateService } from "@ngx-translate/core";
-import { ErrorHandler } from "../../../lib/utils/error-handler";
-import { UserPermissionService, USERSTATICPERMISSION } from "../../../lib/services";
+import { ErrorHandler } from "../../../shared/units/error-handler";
+import { UserPermissionService, USERSTATICPERMISSION } from "../../../shared/services";
+import { InlineAlertComponent } from "../../../shared/components/inline-alert/inline-alert.component";
@Component({
@@ -49,7 +49,7 @@ export class ScannerComponent implements OnInit {
) {
}
ngOnInit() {
- this.projectId = +this.route.snapshot.parent.params['id'];
+ this.projectId = +this.route.snapshot.parent.parent.params['id'];
this.getPermission();
this.init();
}
diff --git a/src/portal/src/app/project/summary/summary.component.html b/src/portal/src/app/base/project/summary/summary.component.html
similarity index 100%
rename from src/portal/src/app/project/summary/summary.component.html
rename to src/portal/src/app/base/project/summary/summary.component.html
diff --git a/src/portal/src/app/project/summary/summary.component.scss b/src/portal/src/app/base/project/summary/summary.component.scss
similarity index 100%
rename from src/portal/src/app/project/summary/summary.component.scss
rename to src/portal/src/app/base/project/summary/summary.component.scss
diff --git a/src/portal/src/app/project/summary/summary.component.spec.ts b/src/portal/src/app/base/project/summary/summary.component.spec.ts
similarity index 73%
rename from src/portal/src/app/project/summary/summary.component.spec.ts
rename to src/portal/src/app/base/project/summary/summary.component.spec.ts
index bd540cfd8d..44d5f80e24 100644
--- a/src/portal/src/app/project/summary/summary.component.spec.ts
+++ b/src/portal/src/app/base/project/summary/summary.component.spec.ts
@@ -1,16 +1,14 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
-import { ClarityModule } from '@clr/angular';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { ActivatedRoute } from '@angular/router';
import { of } from 'rxjs';
-import { AppConfigService } from "../../services/app-config.service";
+import { AppConfigService } from "../../../services/app-config.service";
import { SummaryComponent } from './summary.component';
-import { EndpointDefaultService, EndpointService, ProjectService, UserPermissionService } from '../../../lib/services';
-import { ErrorHandler } from "../../../lib/utils/error-handler";
-import { IServiceConfig, SERVICE_CONFIG } from '../../../lib/entities/service.config';
-import { CURRENT_BASE_HREF } from '../../../lib/utils/utils';
-import { SessionService } from '../../shared/session.service';
+import { ProjectService, UserPermissionService } from '../../../shared/services';
+import { ErrorHandler } from "../../../shared/units/error-handler";
+import { SessionService } from '../../../shared/services/session.service';
+import { EndpointService } from "../../../shared/services/endpoint.service";
+import { SharedTestingModule } from "../../../shared/shared.module";
describe('SummaryComponent', () => {
@@ -34,10 +32,6 @@ describe('SummaryComponent', () => {
return of([true, true]);
}
};
- const config: IServiceConfig = {
- systemInfoEndpoint: CURRENT_BASE_HREF + "/endpoints/testing"
- };
-
const fakedSessionService = {
getCurrentUser() {
return {
@@ -71,32 +65,30 @@ describe('SummaryComponent', () => {
TestBed.configureTestingModule({
declarations: [SummaryComponent],
imports: [
- ClarityModule,
- TranslateModule.forRoot()
+ SharedTestingModule
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
],
providers: [
- TranslateService,
{ provide: AppConfigService, useValue: fakeAppConfigService },
{ provide: ProjectService, useValue: fakeProjectService },
{ provide: ErrorHandler, useValue: fakeErrorHandler },
{ provide: UserPermissionService, useValue: fakeUserPermissionService },
{ provide: EndpointService, useValue: fakedEndpointService },
- { provide: SERVICE_CONFIG, useValue: config },
{ provide: SessionService, useValue: fakedSessionService},
{
provide: ActivatedRoute, useValue: {
paramMap: of({ get: (key) => 'value' }),
- snapshot: {
+ parent: {
parent: {
- params: { id: 1 },
- data: {
- projectResolver: {registry_id: 3}
+ snapshot: {
+ params: { id: 1 },
+ data: {
+ projectResolver: {registry_id: 3}
+ },
}
- },
- }
+ }},
}
},
]
diff --git a/src/portal/src/app/project/summary/summary.component.ts b/src/portal/src/app/base/project/summary/summary.component.ts
similarity index 81%
rename from src/portal/src/app/project/summary/summary.component.ts
rename to src/portal/src/app/base/project/summary/summary.component.ts
index b7914d5955..a5ef0dedfe 100644
--- a/src/portal/src/app/project/summary/summary.component.ts
+++ b/src/portal/src/app/base/project/summary/summary.component.ts
@@ -1,18 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
-import { AppConfigService } from "../../services/app-config.service";
-import { QUOTA_DANGER_COEFFICIENT, QUOTA_WARNING_COEFFICIENT, QuotaUnits } from "../../../lib/entities/shared.const";
+import { AppConfigService } from "../../../services/app-config.service";
+import { QUOTA_DANGER_COEFFICIENT, QUOTA_WARNING_COEFFICIENT, QuotaUnits } from "../../../shared/entities/shared.const";
import {
Endpoint,
- EndpointService,
ProjectService,
UserPermissionService,
USERSTATICPERMISSION
-} from '../../../lib/services';
-import { ErrorHandler } from "../../../lib/utils/error-handler";
-import { clone, GetIntegerAndUnit, getSuitableUnit as getSuitableUnitFn } from "../../../lib/utils/utils";
-import { SessionService } from '../../shared/session.service';
-import { Project } from '../project';
+} from '../../../shared/services';
+import { ErrorHandler } from "../../../shared/units/error-handler";
+import { clone, GetIntegerAndUnit, getSuitableUnit as getSuitableUnitFn } from "../../../shared/units/utils";
@Component({
selector: 'summary',
@@ -37,7 +34,7 @@ export class SummaryComponent implements OnInit {
) { }
ngOnInit() {
- this.projectId = this.route.snapshot.parent.params['id'];
+ this.projectId = this.route.parent.parent.snapshot.params['id'];
const permissions = [
{resource: USERSTATICPERMISSION.MEMBER.KEY, action: USERSTATICPERMISSION.MEMBER.VALUE.LIST},
{resource: USERSTATICPERMISSION.QUOTA.KEY, action: USERSTATICPERMISSION.QUOTA.VALUE.READ},
diff --git a/src/portal/src/app/base/project/summary/summary.module.ts b/src/portal/src/app/base/project/summary/summary.module.ts
new file mode 100644
index 0000000000..f2ded633dc
--- /dev/null
+++ b/src/portal/src/app/base/project/summary/summary.module.ts
@@ -0,0 +1,19 @@
+import { NgModule } from '@angular/core';
+import { SummaryComponent } from './summary.component';
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "../../../shared/shared.module";
+
+const routes: Routes = [
+ {
+ path: '',
+ component: SummaryComponent
+ }
+];
+@NgModule({
+ declarations: [SummaryComponent],
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule
+ ]
+})
+export class SummaryModule { }
diff --git a/src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.html b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.html
similarity index 100%
rename from src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.html
rename to src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.html
diff --git a/src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.scss b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.scss
similarity index 100%
rename from src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.scss
rename to src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.scss
diff --git a/src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.spec.ts b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.spec.ts
similarity index 88%
rename from src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.spec.ts
rename to src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.spec.ts
index a99958abf3..6b1c7585fc 100644
--- a/src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.spec.ts
+++ b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.spec.ts
@@ -1,19 +1,19 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { ClarityModule } from '@clr/angular';
import { FormsModule } from '@angular/forms';
-import { AddRuleComponent } from './add-rule.component';
import { CUSTOM_ELEMENTS_SCHEMA, EventEmitter } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { ImmutableTagService } from '../immutable-tag.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
-import { InlineAlertComponent } from "../../../../shared/inline-alert/inline-alert.component";
import { ImmutableRetentionRule } from "../../tag-retention/retention";
-import { ErrorHandler } from '../../../../../lib/utils/error-handler';
+import { ErrorHandler } from '../../../../../shared/units/error-handler';
+import { InlineAlertComponent } from "../../../../../shared/components/inline-alert/inline-alert.component";
+import { AddImmutableRuleComponent } from "./add-immutable-rule.component";
describe('AddRuleComponent', () => {
- let component: AddRuleComponent;
- let fixture: ComponentFixture;
+ let component: AddImmutableRuleComponent;
+ let fixture: ComponentFixture;
let mockRule = {
"id": 1,
"project_id": 1,
@@ -43,7 +43,7 @@ describe('AddRuleComponent', () => {
};
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
- declarations: [AddRuleComponent, InlineAlertComponent],
+ declarations: [AddImmutableRuleComponent, InlineAlertComponent],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
],
@@ -66,7 +66,7 @@ describe('AddRuleComponent', () => {
}));
beforeEach(() => {
- fixture = TestBed.createComponent(AddRuleComponent);
+ fixture = TestBed.createComponent(AddImmutableRuleComponent);
component = fixture.componentInstance;
fixture.detectChanges();
component.addRuleOpened = true;
diff --git a/src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.ts b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.ts
similarity index 93%
rename from src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.ts
rename to src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.ts
index 03353aa8f7..388acbda60 100644
--- a/src/portal/src/app/project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.ts
+++ b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.ts
@@ -7,17 +7,17 @@ import {
} from "@angular/core";
import { ImmutableRetentionRule, RuleMetadate } from "../../tag-retention/retention";
import { ImmutableTagService } from "../immutable-tag.service";
-import { compareValue } from "../../../../../lib/utils/utils";
-import { InlineAlertComponent } from "../../../../shared/inline-alert/inline-alert.component";
+import { compareValue } from "../../../../../shared/units/utils";
+import { InlineAlertComponent } from "../../../../../shared/components/inline-alert/inline-alert.component";
const EXISTING_RULE = "TAG_RETENTION.EXISTING_RULE";
const INVALID_RULE = "TAG_RETENTION.INVALID_RULE";
@Component({
- selector: 'app-add-rule',
- templateUrl: './add-rule.component.html',
- styleUrls: ['./add-rule.component.scss']
+ selector: 'app-add-immutable-rule',
+ templateUrl: './add-immutable-rule.component.html',
+ styleUrls: ['./add-immutable-rule.component.scss']
})
-export class AddRuleComponent implements OnInit, OnDestroy {
+export class AddImmutableRuleComponent implements OnInit, OnDestroy {
addRuleOpened: boolean = false;
@Output() clickAdd = new EventEmitter();
@Input() rules: ImmutableRetentionRule[];
diff --git a/src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.component.html b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/immutable-tag.component.html
similarity index 96%
rename from src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.component.html
rename to src/portal/src/app/base/project/tag-feature-integration/immutable-tag/immutable-tag.component.html
index 3b62374cf9..f87f89e951 100644
--- a/src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.component.html
+++ b/src/portal/src/app/base/project/tag-feature-integration/immutable-tag/immutable-tag.component.html
@@ -56,5 +56,5 @@