mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-28 13:27:31 +02:00
Upgrade Angular and Clarity to the latest version (#18709)
1.Upgrade Angular to 16.0.2 2.Upgrade Clarity to 15.4.0 Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
9d042ad585
commit
43c6586af4
@ -1,7 +1,7 @@
|
|||||||
```text
|
```text
|
||||||
{
|
{
|
||||||
"name": "harbor",
|
"name": "harbor",
|
||||||
"version": "2.8.0",
|
"version": "2.9.0",
|
||||||
"description": "Harbor UI with Clarity",
|
"description": "Harbor UI with Clarity",
|
||||||
"angular-cli": {},
|
"angular-cli": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -27,8 +27,7 @@
|
|||||||
"test:chrome-debug": "ng test --code-coverage --browsers Chrome --watch",
|
"test:chrome-debug": "ng test --code-coverage --browsers Chrome --watch",
|
||||||
|
|
||||||
// E2e related. Currently not used
|
// E2e related. Currently not used
|
||||||
"pree2e": "webdriver-manager update",
|
"e2e": "ng e2e",
|
||||||
"e2e": "protractor",
|
|
||||||
|
|
||||||
"build": "ng build --aot",
|
"build": "ng build --aot",
|
||||||
"release": "ng build --configuration production",
|
"release": "ng build --configuration production",
|
||||||
@ -47,28 +46,28 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
// Angular framework. Required
|
// Angular framework. Required
|
||||||
"@angular/animations": "^15.2.1",
|
"@angular/animations": "^16.0.2",
|
||||||
"@angular/common": "^15.2.1",
|
"@angular/common": "^16.0.2",
|
||||||
"@angular/compiler": "^15.2.1,
|
"@angular/compiler": "^16.0.2,
|
||||||
"@angular/core": "^15.2.1",
|
"@angular/core": "^16.0.2",
|
||||||
"@angular/forms": "^15.2.1",
|
"@angular/forms": "^16.0.2",
|
||||||
"@angular/localize": "^15.2.1",
|
"@angular/localize": "^16.0.2",
|
||||||
"@angular/platform-browser": "^15.2.1",
|
"@angular/platform-browser": "^16.0.2",
|
||||||
"@angular/platform-browser-dynamic": "^15.2.1",
|
"@angular/platform-browser-dynamic": "^16.0.2",
|
||||||
"@angular/router": "^15.2.1",
|
"@angular/router": "^16.0.2",
|
||||||
"rxjs": "^7.4.0",
|
"rxjs": "^7.4.0",
|
||||||
"tslib": "^2.2.0",
|
"tslib": "^2.2.0",
|
||||||
"zone.js": "~0.11.4",
|
"zone.js": "~0.13.0",
|
||||||
|
|
||||||
// Clarity UI. Required
|
// Clarity UI. Required
|
||||||
"@clr/angular": "15.0.1",
|
"@cds/core": "6.4.2",
|
||||||
"@cds/core": "6.2.3",
|
"@clr/angular": "15.4.0",
|
||||||
"@clr/icons": "13.0.2",
|
"@clr/icons": "13.0.2",
|
||||||
"@clr/ui": "15.0.1",
|
"@clr/ui": "15.4.0",
|
||||||
|
|
||||||
// For Harbor i18n functionality. Required
|
// For Harbor i18n functionality. Required
|
||||||
"@ngx-translate/core": "^14.0.0",
|
"@ngx-translate/core": "15.0.0",
|
||||||
"@ngx-translate/http-loader": "^7.0.0",
|
"@ngx-translate/http-loader": "8.0.0",
|
||||||
|
|
||||||
// For cron string checking. Required
|
// For cron string checking. Required
|
||||||
"cron-validator": "^1.2.1",
|
"cron-validator": "^1.2.1",
|
||||||
@ -80,24 +79,24 @@
|
|||||||
"ngx-cookie": "^5.0.2",
|
"ngx-cookie": "^5.0.2",
|
||||||
|
|
||||||
// To render markdown data. Required
|
// To render markdown data. Required
|
||||||
"ngx-markdown": "~15.1.1",
|
"ngx-markdown": "16.0.0",
|
||||||
|
|
||||||
// To convert yaml to json. Required
|
// To convert yaml to json. Required
|
||||||
"js-yaml": "^4.1.0"
|
"js-yaml": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
// Angular framework. Required
|
// Angular framework. Required
|
||||||
"@angular-devkit/build-angular": "^15.2.1",
|
"@angular-devkit/build-angular": "^16.0.2",
|
||||||
"@angular/cli": "^15.2.1",
|
"@angular/cli": "^16.0.2",
|
||||||
"@angular/compiler-cli": "^15.2.1",
|
"@angular/compiler-cli": "^16.0.2",
|
||||||
"@types/jasmine": "~4.3.0",
|
"@types/jasmine": "~4.3.0",
|
||||||
"@types/node": "^16.11.6",
|
"@types/node": "^16.11.6",
|
||||||
"typescript": "~4.8.2",
|
"typescript": "~5.0.4",
|
||||||
|
|
||||||
// For unit test. Required
|
// For unit test. Required
|
||||||
"jasmine-core": "~4.5.0",
|
"jasmine-core": "~4.5.0",
|
||||||
"jasmine-spec-reporter": "~7.0.0",
|
"jasmine-spec-reporter": "~7.0.0",
|
||||||
"karma": "^6.3.17",
|
"karma": "^6.4.2",
|
||||||
"karma-chrome-launcher": "~3.1.0",
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
"karma-coverage": "^2.2.0",
|
"karma-coverage": "^2.2.0",
|
||||||
"karma-jasmine": "~4.0.1",
|
"karma-jasmine": "~4.0.1",
|
||||||
@ -112,7 +111,7 @@
|
|||||||
"ng-swagger-gen": "^1.8.1",
|
"ng-swagger-gen": "^1.8.1",
|
||||||
|
|
||||||
// For e2e test. Required
|
// For e2e test. Required
|
||||||
"cypress": "latest"
|
"cypress": "12.12.0"
|
||||||
|
|
||||||
// For code grammar checking. Optional
|
// For code grammar checking. Optional
|
||||||
"eslint": "^8.12.0",
|
"eslint": "^8.12.0",
|
||||||
|
3959
src/portal/package-lock.json
generated
3959
src/portal/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,6 @@
|
|||||||
"test:chrome": "ng test --code-coverage --browsers Chrome",
|
"test:chrome": "ng test --code-coverage --browsers Chrome",
|
||||||
"test:headless": "ng test --watch=false --no-progress --code-coverage --browsers=ChromeNoSandboxHeadless",
|
"test:headless": "ng test --watch=false --no-progress --code-coverage --browsers=ChromeNoSandboxHeadless",
|
||||||
"test:chrome-debug": "ng test --code-coverage --browsers Chrome --watch",
|
"test:chrome-debug": "ng test --code-coverage --browsers Chrome --watch",
|
||||||
"pree2e": "webdriver-manager update",
|
|
||||||
"e2e": "ng e2e",
|
"e2e": "ng e2e",
|
||||||
"build": "ng build --aot",
|
"build": "ng build --aot",
|
||||||
"release": "ng build --configuration production",
|
"release": "ng build --configuration production",
|
||||||
@ -28,53 +27,53 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^15.2.1",
|
"@angular/animations": "^16.0.2",
|
||||||
"@angular/common": "^15.2.1",
|
"@angular/common": "^16.0.2",
|
||||||
"@angular/compiler": "^15.2.1",
|
"@angular/compiler": "^16.0.2",
|
||||||
"@angular/core": "^15.2.1",
|
"@angular/core": "^16.0.2",
|
||||||
"@angular/forms": "^15.2.1",
|
"@angular/forms": "^16.0.2",
|
||||||
"@angular/localize": "^15.2.1",
|
"@angular/localize": "^16.0.2",
|
||||||
"@angular/platform-browser": "^15.2.1",
|
"@angular/platform-browser": "^16.0.2",
|
||||||
"@angular/platform-browser-dynamic": "^15.2.1",
|
"@angular/platform-browser-dynamic": "^16.0.2",
|
||||||
"@angular/router": "^15.2.1",
|
"@angular/router": "^16.0.2",
|
||||||
"@cds/core": "6.2.3",
|
"@cds/core": "6.4.2",
|
||||||
"@clr/angular": "15.0.3",
|
"@clr/angular": "15.4.0",
|
||||||
"@clr/icons": "13.0.2",
|
"@clr/icons": "13.0.2",
|
||||||
"@clr/ui": "15.0.3",
|
"@clr/ui": "15.4.0",
|
||||||
"@ngx-translate/core": "^14.0.0",
|
"@ngx-translate/core": "15.0.0",
|
||||||
"@ngx-translate/http-loader": "^7.0.0",
|
"@ngx-translate/http-loader": "8.0.0",
|
||||||
"cron-validator": "^1.3.1",
|
"cron-validator": "^1.3.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"ngx-clipboard": "^15.1.0",
|
"ngx-clipboard": "^15.1.0",
|
||||||
"ngx-cookie": "^6.0.1",
|
"ngx-cookie": "^6.0.1",
|
||||||
"ngx-markdown": "15.1.1",
|
"ngx-markdown": "16.0.0",
|
||||||
"rxjs": "^7.4.0",
|
"rxjs": "^7.4.0",
|
||||||
"tslib": "^2.2.0",
|
"tslib": "^2.2.0",
|
||||||
"zone.js": "~0.11.4"
|
"zone.js": "~0.13.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^15.2.1",
|
"@angular-devkit/build-angular": "^16.0.2",
|
||||||
"@angular-eslint/builder": "15.1.0",
|
"@angular-eslint/builder": "16.0.2",
|
||||||
"@angular-eslint/eslint-plugin": "15.1.0",
|
"@angular-eslint/eslint-plugin": "16.0.2",
|
||||||
"@angular-eslint/eslint-plugin-template": "15.1.0",
|
"@angular-eslint/eslint-plugin-template": "16.0.2",
|
||||||
"@angular-eslint/schematics": "15.1.0",
|
"@angular-eslint/schematics": "16.0.2",
|
||||||
"@angular-eslint/template-parser": "15.1.0",
|
"@angular-eslint/template-parser": "16.0.2",
|
||||||
"@angular/cli": "^15.2.1",
|
"@angular/cli": "^16.0.2",
|
||||||
"@angular/compiler-cli": "^15.2.1",
|
"@angular/compiler-cli": "^16.0.2",
|
||||||
"@cypress/schematic": "^2.5.0",
|
"@cypress/schematic": "^2.5.0",
|
||||||
"@types/express": "^4.17.12",
|
"@types/express": "^4.17.12",
|
||||||
"@types/jasmine": "~4.3.1",
|
"@types/jasmine": "~4.3.1",
|
||||||
"@types/node": "^16.11.6",
|
"@types/node": "^16.11.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
"@typescript-eslint/eslint-plugin": "^5.59.6",
|
||||||
"@typescript-eslint/parser": "^5.29.0",
|
"@typescript-eslint/parser": "^5.59.6",
|
||||||
"eslint": "^8.18.0",
|
"eslint": "^8.41.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"https-proxy-agent": "^5.0.1",
|
"https-proxy-agent": "^5.0.1",
|
||||||
"jasmine-core": "~4.5.0",
|
"jasmine-core": "~4.5.0",
|
||||||
"jasmine-spec-reporter": "~7.0.0",
|
"jasmine-spec-reporter": "~7.0.0",
|
||||||
"karma": "^6.4.0",
|
"karma": "6.4.2",
|
||||||
"karma-chrome-launcher": "~3.1.0",
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
"karma-coverage": "^2.2.0",
|
"karma-coverage": "^2.2.0",
|
||||||
"karma-jasmine": "~4.0.1",
|
"karma-jasmine": "~4.0.1",
|
||||||
@ -82,12 +81,12 @@
|
|||||||
"ng-swagger-gen": "^1.8.1",
|
"ng-swagger-gen": "^1.8.1",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"prettier-eslint": "^14.0.2",
|
"prettier-eslint": "^14.0.2",
|
||||||
"stylelint": "^14.8.5",
|
"stylelint": "^14.16.1",
|
||||||
"stylelint-config-prettier": "^9.0.3",
|
"stylelint-config-prettier": "^9.0.5",
|
||||||
"stylelint-config-prettier-scss": "^0.0.1",
|
"stylelint-config-prettier-scss": "^0.0.1",
|
||||||
"stylelint-config-standard": "^25.0.0",
|
"stylelint-config-standard": "^29.0.0",
|
||||||
"stylelint-config-standard-scss": "^4.0.0",
|
"stylelint-config-standard-scss": "^6.1.0",
|
||||||
"typescript": "~4.8.2",
|
"typescript": "~5.0.4",
|
||||||
"cypress": "latest"
|
"cypress": "12.12.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
||||||
|
|
||||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||||
CanActivate,
|
|
||||||
ActivatedRouteSnapshot,
|
|
||||||
RouterStateSnapshot,
|
|
||||||
} from '@angular/router';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { UserPrivilegeServeItem } from 'src/app/shared/services/interface';
|
import { UserPrivilegeServeItem } from 'src/app/shared/services/interface';
|
||||||
import { MemberPermissionGuard } from '../../../shared/router-guard/member-permission-guard-activate.service';
|
import { MemberPermissionGuard } from '../../../shared/router-guard/member-permission-guard-activate.service';
|
||||||
@ -11,7 +7,7 @@ import { MemberPermissionGuard } from '../../../shared/router-guard/member-permi
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class TagFeatureGuardService implements CanActivate {
|
export class TagFeatureGuardService {
|
||||||
constructor(private memberPermissionGuard: MemberPermissionGuard) {}
|
constructor(private memberPermissionGuard: MemberPermissionGuard) {}
|
||||||
|
|
||||||
canActivate(
|
canActivate(
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
Router,
|
Router,
|
||||||
Resolve,
|
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
@ -29,7 +28,7 @@ import { dbEncodeURIComponent } from '../../shared/units/utils';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ArtifactDetailRoutingResolverService implements Resolve<Artifact> {
|
export class ArtifactDetailRoutingResolverService {
|
||||||
constructor(
|
constructor(
|
||||||
private projectService: ProjectService,
|
private projectService: ProjectService,
|
||||||
private artifactService: ArtifactService,
|
private artifactService: ArtifactService,
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
Router,
|
Router,
|
||||||
Resolve,
|
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
@ -28,7 +27,7 @@ import { RoleInfo, Roles } from '../../shared/entities/shared.const';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ProjectRoutingResolver implements Resolve<Project> {
|
export class ProjectRoutingResolver {
|
||||||
constructor(
|
constructor(
|
||||||
private sessionService: SessionService,
|
private sessionService: SessionService,
|
||||||
private projectService: ProjectService,
|
private projectService: ProjectService,
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
Router,
|
Router,
|
||||||
Resolve,
|
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
@ -26,9 +25,7 @@ import { ReplicationExecution } from '../../../../ng-swagger-gen/models/replicat
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ReplicationTasksRoutingResolverService
|
export class ReplicationTasksRoutingResolverService {
|
||||||
implements Resolve<ReplicationExecution>
|
|
||||||
{
|
|
||||||
constructor(
|
constructor(
|
||||||
private replicationService: ReplicationService,
|
private replicationService: ReplicationService,
|
||||||
private router: Router
|
private router: Router
|
||||||
|
@ -32,7 +32,6 @@ export class ClipboardDirective implements OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('click', ['$event.target'])
|
@HostListener('click', ['$event.target'])
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
public onClick(button: ElementRef) {
|
public onClick(button: ElementRef) {
|
||||||
if (!this.clipboardSrv.isSupported) {
|
if (!this.clipboardSrv.isSupported) {
|
||||||
this.handleResult(false, undefined);
|
this.handleResult(false, undefined);
|
||||||
|
@ -13,11 +13,9 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
CanActivate,
|
|
||||||
Router,
|
Router,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
CanActivateChild,
|
|
||||||
NavigationExtras,
|
NavigationExtras,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { SessionService } from '../services/session.service';
|
import { SessionService } from '../services/session.service';
|
||||||
@ -31,7 +29,7 @@ import { CommonRoutes, CONFIG_AUTH_MODE } from '../entities/shared.const';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class AuthCheckGuard implements CanActivate, CanActivateChild {
|
export class AuthCheckGuard {
|
||||||
constructor(
|
constructor(
|
||||||
private authService: SessionService,
|
private authService: SessionService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -13,11 +13,9 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
CanActivate,
|
|
||||||
Router,
|
Router,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
CanActivateChild,
|
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { SessionService } from '../services/session.service';
|
import { SessionService } from '../services/session.service';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
@ -31,7 +29,7 @@ import { UN_LOGGED_PARAM, YES } from 'src/app/account/sign-in/sign-in.service';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class MemberGuard implements CanActivate, CanActivateChild {
|
export class MemberGuard {
|
||||||
constructor(
|
constructor(
|
||||||
private sessionService: SessionService,
|
private sessionService: SessionService,
|
||||||
private projectService: ProjectService,
|
private projectService: ProjectService,
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
CanActivate,
|
|
||||||
Router,
|
Router,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
CanActivateChild,
|
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { ErrorHandler } from '../units/error-handler';
|
import { ErrorHandler } from '../units/error-handler';
|
||||||
@ -14,7 +12,7 @@ import { CommonRoutes } from '../entities/shared.const';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class MemberPermissionGuard implements CanActivate, CanActivateChild {
|
export class MemberPermissionGuard {
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private errorHandler: ErrorHandler,
|
private errorHandler: ErrorHandler,
|
||||||
|
@ -13,11 +13,9 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
CanActivate,
|
|
||||||
Router,
|
Router,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
CanActivateChild,
|
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { AppConfigService } from '../../services/app-config.service';
|
import { AppConfigService } from '../../services/app-config.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
@ -26,7 +24,7 @@ import { CommonRoutes } from '../entities/shared.const';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ModeGuard implements CanActivate, CanActivateChild {
|
export class ModeGuard {
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private appConfigService: AppConfigService
|
private appConfigService: AppConfigService
|
||||||
|
@ -13,11 +13,9 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
CanActivate,
|
|
||||||
Router,
|
Router,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
CanActivateChild,
|
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { AppConfigService } from '../../services/app-config.service';
|
import { AppConfigService } from '../../services/app-config.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
@ -26,7 +24,7 @@ import { CommonRoutes } from '../entities/shared.const';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class OidcGuard implements CanActivate, CanActivateChild {
|
export class OidcGuard {
|
||||||
constructor(
|
constructor(
|
||||||
private appConfigService: AppConfigService,
|
private appConfigService: AppConfigService,
|
||||||
private router: Router
|
private router: Router
|
||||||
|
@ -13,11 +13,9 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
CanActivate,
|
|
||||||
Router,
|
Router,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
CanActivateChild,
|
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { SessionService } from '../services/session.service';
|
import { SessionService } from '../services/session.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
@ -26,7 +24,7 @@ import { CommonRoutes } from '../entities/shared.const';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SignInGuard implements CanActivate, CanActivateChild {
|
export class SignInGuard {
|
||||||
constructor(private authService: SessionService, private router: Router) {}
|
constructor(private authService: SessionService, private router: Router) {}
|
||||||
|
|
||||||
canActivate(
|
canActivate(
|
||||||
|
@ -13,11 +13,9 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
CanActivate,
|
|
||||||
Router,
|
Router,
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
CanActivateChild,
|
|
||||||
NavigationExtras,
|
NavigationExtras,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { SessionService } from '../services/session.service';
|
import { SessionService } from '../services/session.service';
|
||||||
@ -28,7 +26,7 @@ import { CommonRoutes } from '../entities/shared.const';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SystemAdminGuard implements CanActivate, CanActivateChild {
|
export class SystemAdminGuard {
|
||||||
constructor(
|
constructor(
|
||||||
private authService: SessionService,
|
private authService: SessionService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -175,7 +175,7 @@ export class EndpointDefaultService extends EndpointService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getEndpoint(endpointId: number | string): Observable<Endpoint> {
|
public getEndpoint(endpointId: number | string): Observable<Endpoint> {
|
||||||
if (!endpointId || endpointId <= 0) {
|
if (!endpointId || +endpointId <= 0) {
|
||||||
return observableThrowError('Bad request argument.');
|
return observableThrowError('Bad request argument.');
|
||||||
}
|
}
|
||||||
let requestUrl: string = `${this._endpointUrl}/${endpointId}`;
|
let requestUrl: string = `${this._endpointUrl}/${endpointId}`;
|
||||||
@ -205,7 +205,7 @@ export class EndpointDefaultService extends EndpointService {
|
|||||||
endpointId: number | string,
|
endpointId: number | string,
|
||||||
endpoint: Endpoint
|
endpoint: Endpoint
|
||||||
): Observable<any> {
|
): Observable<any> {
|
||||||
if (!endpointId || endpointId <= 0) {
|
if (!endpointId || +endpointId <= 0) {
|
||||||
return observableThrowError('Bad request argument.');
|
return observableThrowError('Bad request argument.');
|
||||||
}
|
}
|
||||||
if (!endpoint) {
|
if (!endpoint) {
|
||||||
@ -218,7 +218,7 @@ export class EndpointDefaultService extends EndpointService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public deleteEndpoint(endpointId: number | string): Observable<any> {
|
public deleteEndpoint(endpointId: number | string): Observable<any> {
|
||||||
if (!endpointId || endpointId <= 0) {
|
if (!endpointId || +endpointId <= 0) {
|
||||||
return observableThrowError('Bad request argument.');
|
return observableThrowError('Bad request argument.');
|
||||||
}
|
}
|
||||||
let requestUrl: string = `${this._endpointUrl}/${endpointId}`;
|
let requestUrl: string = `${this._endpointUrl}/${endpointId}`;
|
||||||
@ -240,7 +240,7 @@ export class EndpointDefaultService extends EndpointService {
|
|||||||
public getEndpointWithReplicationRules(
|
public getEndpointWithReplicationRules(
|
||||||
endpointId: number | string
|
endpointId: number | string
|
||||||
): Observable<any> {
|
): Observable<any> {
|
||||||
if (!endpointId || endpointId <= 0) {
|
if (!endpointId || +endpointId <= 0) {
|
||||||
return observableThrowError('Bad request argument.');
|
return observableThrowError('Bad request argument.');
|
||||||
}
|
}
|
||||||
let requestUrl: string = `${this._endpointUrl}/${endpointId}/policies`;
|
let requestUrl: string = `${this._endpointUrl}/${endpointId}/policies`;
|
||||||
|
@ -74,7 +74,7 @@ export class JobLogDefaultService extends JobLogService {
|
|||||||
if (!this._isSupportedJobType(jobType)) {
|
if (!this._isSupportedJobType(jobType)) {
|
||||||
return observableThrowError('Unsupport job type: ' + jobType);
|
return observableThrowError('Unsupport job type: ' + jobType);
|
||||||
}
|
}
|
||||||
if (!jobId || jobId <= 0) {
|
if (!jobId || +jobId <= 0) {
|
||||||
return observableThrowError('Bad argument');
|
return observableThrowError('Bad argument');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,7 +350,7 @@ export class ReplicationDefaultService extends ReplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public deleteReplicationRule(ruleId: number | string): Observable<any> {
|
public deleteReplicationRule(ruleId: number | string): Observable<any> {
|
||||||
if (!ruleId || ruleId <= 0) {
|
if (!ruleId || +ruleId <= 0) {
|
||||||
return observableThrowError('Bad argument');
|
return observableThrowError('Bad argument');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ export class ReplicationDefaultService extends ReplicationService {
|
|||||||
ruleId: number | string,
|
ruleId: number | string,
|
||||||
enablement: number
|
enablement: number
|
||||||
): Observable<any> {
|
): Observable<any> {
|
||||||
if (!ruleId || ruleId <= 0) {
|
if (!ruleId || +ruleId <= 0) {
|
||||||
return observableThrowError('Bad argument');
|
return observableThrowError('Bad argument');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ export class ReplicationDefaultService extends ReplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public disableReplicationRule(ruleId: number | string): Observable<any> {
|
public disableReplicationRule(ruleId: number | string): Observable<any> {
|
||||||
if (!ruleId || ruleId <= 0) {
|
if (!ruleId || +ruleId <= 0) {
|
||||||
return observableThrowError('Bad argument');
|
return observableThrowError('Bad argument');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ export class ReplicationDefaultService extends ReplicationService {
|
|||||||
ruleId: number | string,
|
ruleId: number | string,
|
||||||
queryParams?: RequestQueryParams
|
queryParams?: RequestQueryParams
|
||||||
): Observable<ReplicationExecution> {
|
): Observable<ReplicationExecution> {
|
||||||
if (!ruleId || ruleId <= 0) {
|
if (!ruleId || +ruleId <= 0) {
|
||||||
return observableThrowError('Bad argument');
|
return observableThrowError('Bad argument');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +454,7 @@ export class ReplicationDefaultService extends ReplicationService {
|
|||||||
public getExecutionById(
|
public getExecutionById(
|
||||||
executionId: number | string
|
executionId: number | string
|
||||||
): Observable<ReplicationExecution> {
|
): Observable<ReplicationExecution> {
|
||||||
if (!executionId || executionId <= 0) {
|
if (!executionId || +executionId <= 0) {
|
||||||
return observableThrowError('Bad request argument.');
|
return observableThrowError('Bad request argument.');
|
||||||
}
|
}
|
||||||
let requestUrl: string = `${this._replicateUrl}/executions/${executionId}`;
|
let requestUrl: string = `${this._replicateUrl}/executions/${executionId}`;
|
||||||
@ -493,7 +493,7 @@ export class ReplicationDefaultService extends ReplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getJobLog(jobId: number | string): Observable<string> {
|
public getJobLog(jobId: number | string): Observable<string> {
|
||||||
if (!jobId || jobId <= 0) {
|
if (!jobId || +jobId <= 0) {
|
||||||
return observableThrowError('Bad argument');
|
return observableThrowError('Bad argument');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ export class ReplicationDefaultService extends ReplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public stopJobs(jobId: number | string): Observable<any> {
|
public stopJobs(jobId: number | string): Observable<any> {
|
||||||
if (!jobId || jobId <= 0) {
|
if (!jobId || +jobId <= 0) {
|
||||||
return observableThrowError('Bad request argument.');
|
return observableThrowError('Bad request argument.');
|
||||||
}
|
}
|
||||||
let requestUrl: string = `${this._replicateUrl}/executions/${jobId}`;
|
let requestUrl: string = `${this._replicateUrl}/executions/${jobId}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user