Commit 887d693f authored by AllForNothing's avatar AllForNothing
Browse files

Add routing-resolvers


Signed-off-by: default avatarAllForNothing <sshijun@vmware.com>
parent eb2af609
......@@ -19,7 +19,7 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { CookieService } from 'ngx-cookie';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { SessionService } from './shared/session.service';
import { AppConfigService } from './app-config.service';
import { AppConfigService } from './services/app-config.service';
import { AppComponent } from './app.component';
import { ClarityModule } from "@clr/angular";
import { APP_BASE_HREF } from "@angular/common";
......
......@@ -18,9 +18,9 @@ import { TranslateService } from '@ngx-translate/core';
import { CookieService } from 'ngx-cookie';
import { SessionService } from './shared/session.service';
import { AppConfigService } from './app-config.service';
import { ThemeService } from './theme.service';
import { themeArray, ThemeInterface } from './theme';
import { AppConfigService } from './services/app-config.service';
import { ThemeService } from './services/theme.service';
import { themeArray, ThemeInterface } from './services/theme';
import { clone } from '../lib/utils/utils';
const HAS_STYLE_MODE: string = 'styleModeLocal';
......
......@@ -14,7 +14,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, APP_INITIALIZER, LOCALE_ID, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AppComponent } from './app.component';
import { InterceptHttpService } from './intercept-http.service';
import { InterceptHttpService } from './services/intercept-http.service';
import { BaseModule } from './base/base.module';
import { HarborRoutingModule } from './harbor-routing.module';
......@@ -26,8 +26,8 @@ import { DeveloperCenterModule } from './dev-center/dev-center.module';
import { registerLocaleData } from '@angular/common';
import { TranslateService } from "@ngx-translate/core";
import { AppConfigService } from './app-config.service';
import { SkinableConfig } from "./skinable-config.service";
import { AppConfigService } from './services/app-config.service';
import { SkinableConfig } from "./services/skinable-config.service";
import { ProjectConfigComponent } from './project/project-config/project-config.component';
import zh from '@angular/common/locales/zh-Hans';
......
......@@ -3,8 +3,8 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { GlobalSearchComponent } from './global-search.component';
import { SearchTriggerService } from './search-trigger.service';
import { FormsModule } from '@angular/forms';
import { AppConfigService } from '../../app-config.service';
import { SkinableConfig } from "../../skinable-config.service";
import { AppConfigService } from '../../services/app-config.service';
import { SkinableConfig } from "../../services/skinable-config.service";
import { RouterTestingModule } from '@angular/router/testing';
import { of } from 'rxjs';
......
......@@ -19,12 +19,12 @@ import { Subject , Subscription } from "rxjs";
import { SearchTriggerService } from './search-trigger.service';
import { AppConfigService } from '../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import {TranslateService} from "@ngx-translate/core";
import {SkinableConfig} from "../../skinable-config.service";
import {SkinableConfig} from "../../services/skinable-config.service";
const deBounceTime = 500; // ms
......
......@@ -4,13 +4,13 @@ import { SearchResults } from './search-results';
import { SearchTriggerService } from './search-trigger.service';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { AppConfigService } from './../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import { ListProjectROComponent } from '../../shared/list-project-ro/list-project-ro.component';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { SearchResultComponent } from './search-result.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { of } from 'rxjs';
import { AppConfig } from '../../app-config';
import { AppConfig } from '../../services/app-config';
import { ClarityModule } from '@clr/angular';
describe('SearchResultComponent', () => {
......
......@@ -18,7 +18,7 @@ import { GlobalSearchService } from './global-search.service';
import { SearchResults } from './search-results';
import { SearchTriggerService } from './search-trigger.service';
import { AppConfigService } from './../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { filter, switchMap } from "rxjs/operators";
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AppConfigService } from '../..//app-config.service';
import { RouterTestingModule } from '@angular/router/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { SessionService } from '../../shared/session.service';
......@@ -18,8 +17,9 @@ import { FormsModule } from '@angular/forms';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { AccountSettingsModalService } from '../../account/account-settings/account-settings-modal-service.service';
import { PasswordSettingService } from '../../account/password-setting/password-setting.service';
import { SkinableConfig } from '../../skinable-config.service';
import { SkinableConfig } from '../../services/skinable-config.service';
import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.component';
import { AppConfigService } from "../../services/app-config.service";
describe('HarborShellComponent', () => {
let component: HarborShellComponent;
......
......@@ -14,7 +14,7 @@
import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Subscription } from "rxjs";
import { AppConfigService } from '../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import { ModalEvent } from '../modal-event';
import { modalEvents } from '../modal-events.const';
......
......@@ -6,10 +6,10 @@ import { PlatformLocation } from '@angular/common';
import { NavigatorComponent } from './navigator.component';
import { RouterTestingModule } from '@angular/router/testing';
import { CookieService } from 'ngx-cookie';
import { AppConfigService } from '../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { SearchTriggerService } from '../global-search/search-trigger.service';
import { SkinableConfig } from "../../skinable-config.service";
import { SkinableConfig } from "../../services/skinable-config.service";
describe('NavigatorComponent', () => {
let component: NavigatorComponent;
......
......@@ -21,14 +21,14 @@ import { modalEvents } from '../modal-events.const';
import { SessionService } from '../../shared/session.service';
import { CookieService, CookieOptions } from 'ngx-cookie';
import { supportedLangs, enLang, languageNames } from '../../shared/shared.const';
import { AppConfigService } from '../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import { SearchTriggerService } from '../global-search/search-trigger.service';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { SkinableConfig } from "../../skinable-config.service";
import { SkinableConfig } from "../../services/skinable-config.service";
import { CommonRoutes } from "../../../lib/entities/shared.const";
import { ThemeInterface, themeArray } from '../../theme';
import { ThemeInterface, themeArray } from '../../services/theme';
import { clone } from '../../../lib/utils/utils';
import { ThemeService } from '../../theme.service';
import { ThemeService } from '../../services/theme.service';
const HAS_STYLE_MODE: string = 'styleModeLocal';
@Component({
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { ConfirmMessageHandler } from '../config.msg.utils';
import { AppConfigService } from '../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import { ConfigurationService } from '../config.service';
import { ConfigurationAuthComponent } from './config-auth.component';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
......
......@@ -16,7 +16,7 @@ import { NgForm } from '@angular/forms';
import { Subscription } from "rxjs";
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { ConfirmMessageHandler } from '../config.msg.utils';
import { AppConfigService } from '../../app-config.service';
import { AppConfigService } from '../../services/app-config.service';
import { ConfigurationService } from '../config.service';
import { Configuration } from "../../../lib/components/config/config";
import { ErrorHandler } from "../../../lib/utils/error-handler";
......
......@@ -5,7 +5,7 @@ import { MessageHandlerService } from '../shared/message-handler/message-handler
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ClarityModule } from "@clr/angular";
import { AppConfigService } from '../app-config.service';
import { AppConfigService } from '../services/app-config.service';
import { ConfigurationService } from './config.service';
import { ConfigurationComponent } from './config.component';
import { of } from 'rxjs';
......
......@@ -17,7 +17,7 @@ import { ConfirmationTargets, ConfirmationState } from '../shared/shared.const';
import { SessionService } from '../shared/session.service';
import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service';
import { MessageHandlerService } from '../shared/message-handler/message-handler.service';
import { AppConfigService } from '../app-config.service';
import { AppConfigService } from '../services/app-config.service';
import { ConfigurationAuthComponent } from './auth/config-auth.component';
import { ConfigurationEmailComponent } from './email/config-email.component';
import { ConfigurationService } from './config.service';
......
......@@ -7,7 +7,7 @@ import { GroupService } from "../group.service";
import { MessageHandlerService } from "./../../shared/message-handler/message-handler.service";
import { SessionService } from "./../../shared/session.service";
import { UserGroup } from "./../group";
import { AppConfigService } from "../../app-config.service";
import { AppConfigService } from "../../services/app-config.service";
import { AddGroupModalComponent } from './add-group-modal.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
......
......@@ -7,7 +7,7 @@ import { GroupService } from "../group.service";
import { MessageHandlerService } from "./../../shared/message-handler/message-handler.service";
import { SessionService } from "./../../shared/session.service";
import { UserGroup } from "./../group";
import { AppConfigService } from "../../app-config.service";
import { AppConfigService } from "../../services/app-config.service";
import { GroupType } from "../../../lib/entities/shared.const";
@Component({
......
......@@ -9,7 +9,7 @@ import { GroupService } from "./group.service";
import { of } from "rxjs";
import { ConfirmationDialogService } from "./../shared/confirmation-dialog/confirmation-dialog.service";
import { MessageHandlerService } from '../shared/message-handler/message-handler.service';
import { AppConfigService } from '../app-config.service';
import { AppConfigService } from '../services/app-config.service';
import { OperationService } from "../../lib/components/operation/operation.service";
describe('GroupComponent', () => {
......
......@@ -16,7 +16,7 @@ import { UserGroup } from "./group";
import { GroupService } from "./group.service";
import { MessageHandlerService } from "../shared/message-handler/message-handler.service";
import { throwError as observableThrowError } from "rxjs";
import { AppConfigService } from '../app-config.service';
import { AppConfigService } from '../services/app-config.service';
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";
......
......@@ -29,7 +29,6 @@ import { SignInComponent } from './sign-in/sign-in.component';
import { ResetPasswordComponent } from './account/password-setting/reset-password/reset-password.component';
import { GroupComponent } from './group/group.component';
import { TotalReplicationPageComponent } from './replication/total-replication/total-replication-page.component';
import { ReplicationTasksPageComponent } from './replication/replication-tasks-page/replication-tasks-page.component';
import { DestinationPageComponent } from './replication/destination/destination-page.component';
import { AuditLogComponent } from './log/audit-log.component';
import { LogPageComponent } from './log/log-page.component';
......@@ -40,7 +39,7 @@ import { RobotAccountComponent } from './project/robot-account/robot-account.com
import { WebhookComponent } from './project/webhook/webhook.component';
import { ProjectLabelComponent } from './project/project-label/project-label.component';
import { ProjectConfigComponent } from './project/project-config/project-config.component';
import { ProjectRoutingResolver } from './project/project-routing-resolver.service';
import { ProjectRoutingResolver } from './services/routing-resolvers/project-routing-resolver.service';
import { ListChartsComponent } from './project/helm-chart/list-charts.component';
import { ListChartVersionsComponent } from './project/helm-chart/list-chart-versions/list-chart-versions.component';
import { HelmChartDetailComponent } from './project/helm-chart/helm-chart-detail/chart-detail.component';
......@@ -60,6 +59,9 @@ import { USERSTATICPERMISSION } from "../lib/services";
import { RepositoryGridviewComponent } from "./project/repository/repository-gridview.component";
import { ArtifactListPageComponent } from "./project/repository/artifact-list-page/artifact-list-page.component";
import { ArtifactSummaryComponent } from "./project/repository/artifact/artifact-summary.component";
import { ReplicationTasksComponent } from "../lib/components/replication/replication-tasks/replication-tasks.component";
import { ReplicationTasksRoutingResolverService } from "./services/routing-resolvers/replication-tasks-routing-resolver.service";
import { ArtifactDetailRoutingResolverService } from "./services/routing-resolvers/artifact-detail-routing-resolver.service";
const harborRoutes: Routes = [
{ path: '', redirectTo: 'harbor', pathMatch: 'full' },
......@@ -149,8 +151,11 @@ const harborRoutes: Routes = [
canActivate: [SystemAdminGuard],
},
{
path: 'replications/:id/:tasks',
component: ReplicationTasksPageComponent,
path: 'replications/:id/tasks',
component: ReplicationTasksComponent,
resolve: {
replicationTasksRoutingResolver: ReplicationTasksRoutingResolverService
},
canActivate: [SystemAdminGuard],
canActivateChild: [SystemAdminGuard]
},
......@@ -334,7 +339,7 @@ const harborRoutes: Routes = [
component: ArtifactSummaryComponent,
canActivate: [MemberGuard],
resolve: {
projectResolver: ProjectRoutingResolver
artifactResolver: ArtifactDetailRoutingResolverService
}
},
{
......@@ -342,7 +347,7 @@ const harborRoutes: Routes = [
component: ArtifactSummaryComponent,
canActivate: [MemberGuard],
resolve: {
projectResolver: ProjectRoutingResolver
artifactResolver: ArtifactDetailRoutingResolverService
}
},
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment